﻿/* ==========================================================
   Volantes - Component Styles
   Tema Verde Esmeralda para Público CNH
   ========================================================== */

/* ========== Buttons ========== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    line-height: 1;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Botão Principal - Verde Esmeralda */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
    background: var(--gradient-primary-hover);
    box-shadow: var(--shadow-lg), var(--shadow-glow-lg);
    transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Botão Secundário - Verde Claro */
.btn-secondary {
    background: var(--color-secondary-bg);
    color: var(--color-primary-dark);
    border: 1px solid var(--color-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Botão Outline */
.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
}

/* Botão Ghost */
.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--color-primary);
    background: var(--color-surface-hover);
}

/* Botão Danger */
.btn-danger {
    background: var(--color-error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
}

/* Botão Success */
.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

/* Botão Dark */
.btn-dark {
    background: var(--color-dark);
    color: white;
}

.btn-dark:hover:not(:disabled) {
    background: var(--color-dark-light);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
}

.btn-icon {
    padding: var(--space-3);
    border-radius: var(--radius-md);
}

/* ========== Cards ========== */

.card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.card-hover:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-accent {
    background: var(--color-accent);
    border-color: var(--color-accent-dark);
}

.card-header {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
}

.card-body {
    color: var(--color-text-secondary);
}

.card-footer {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

/* Card Destacado */
.card-featured {
    border: 2px solid var(--color-primary);
    position: relative;
}

.card-featured::before {
    content: '⭐ Destaque';
    position: absolute;
    top: -12px;
    right: var(--space-4);
    background: var(--color-primary);
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
}

/* ========== Forms ========== */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-tertiary);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--color-border-hover);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--color-error);
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-input.success,
.form-select.success,
.form-textarea.success {
    border-color: var(--color-success);
}

.form-input.success:focus,
.form-select.success:focus,
.form-textarea.success:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234B5563'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    background-size: 20px;
    padding-right: var(--space-10);
}

.form-hint {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    margin-top: var(--space-1);
}

.form-error {
    font-size: var(--text-sm);
    color: var(--color-error);
    margin-top: var(--space-1);
}

.form-success {
    font-size: var(--text-sm);
    color: var(--color-success);
    margin-top: var(--space-1);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
}

.form-check-input {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.form-check-label {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
}

/* ========== Badges ========== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-full);
}

.badge-primary {
    background: var(--color-success-bg);
    color: var(--color-primary);
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-warning {
    background: var(--color-warning-bg);
    color: #B45309;
}

.badge-error {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.badge-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.badge-dark {
    background: var(--color-dark);
    color: white;
}

/* ========== Alerts ========== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid;
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
}

.alert-message {
    font-size: var(--text-sm);
}

.alert-success {
    background: var(--color-success-bg);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--color-primary-dark);
}

.alert-warning {
    background: var(--color-warning-bg);
    border-color: rgba(245, 158, 11, 0.3);
    color: #B45309;
}

.alert-error {
    background: var(--color-error-bg);
    border-color: rgba(239, 68, 68, 0.3);
    color: #DC2626;
}

.alert-info {
    background: var(--color-info-bg);
    border-color: rgba(59, 130, 246, 0.3);
    color: #1D4ED8;
}

/* ========== Modal ========== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(31, 41, 55, 0.5);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-xl);
}

.modal-backdrop.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--color-text-tertiary);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-surface-hover);
    color: var(--color-primary);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
}

/* ========== Toast Notifications ========== */

.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight var(--transition-normal) forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    margin-bottom: var(--space-1);
    color: var(--color-text-primary);
}

.toast-message {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.toast-close {
    color: var(--color-text-tertiary);
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--color-primary);
}

.toast-success {
    border-left: 4px solid var(--color-success);
}

.toast-error {
    border-left: 4px solid var(--color-error);
}

.toast-warning {
    border-left: 4px solid var(--color-warning);
}

.toast-info {
    border-left: 4px solid var(--color-info);
}

/* ========== Avatar ========== */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-semibold);
    color: white;
    font-size: var(--text-sm);
    text-transform: uppercase;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: var(--text-xs);
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: var(--text-lg);
}

.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: var(--text-2xl);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.avatar-verified {
    position: relative;
}

.avatar-verified::after {
    content: '✓';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--color-primary);
    color: white;
    font-size: 10px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-bg-primary);
}

/* ========== Loading Spinner ========== */

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* ========== Loading Overlay ========== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    z-index: var(--z-modal);
}

.loading-text {
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
}

/* ========== Empty State ========== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-4);
    color: var(--color-primary);
}

.empty-state-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-2);
    color: var(--color-text-primary);
}

.empty-state-description {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    max-width: 300px;
    margin-bottom: var(--space-6);
}

/* ========== Divider ========== */

.divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-6) 0;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    color: var(--color-text-tertiary);
    font-size: var(--text-sm);
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* ========== Rating Stars ========== */

.rating {
    display: flex;
    gap: var(--space-1);
}

.rating-star {
    width: 20px;
    height: 20px;
    color: var(--color-border);
    cursor: pointer;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.rating-star.filled,
.rating-star:hover {
    color: #FBBF24;
}

.rating-star:hover {
    transform: scale(1.1);
}

/* ========== Tabs ========== */

.tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-6);
}

.tab {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-tertiary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--color-text-primary);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--transition-normal) forwards;
}

/* ========== Dropdown ========== */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-2);
    min-width: 200px;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--color-surface-hover);
    color: var(--color-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-2) 0;
}

/* ========== Progress Bar ========== */

.progress {
    height: 8px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-bar.animated {
    animation: progressPulse 2s infinite;
}

@keyframes progressPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Progress Steps (Etapas da CNH) */
.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: var(--space-8);
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-border);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.progress-step-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--color-bg-primary);
    border: 3px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-2);
    transition: all var(--transition-normal);
}

.progress-step.completed .progress-step-icon {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.progress-step.active .progress-step-icon {
    border-color: var(--color-primary);
    color: var(--color-primary);
    animation: progressPulse 2s infinite;
}

.progress-step-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--color-text-tertiary);
    text-align: center;
}

.progress-step.completed .progress-step-label,
.progress-step.active .progress-step-label {
    color: var(--color-text-primary);
}

/* ========== Skeleton Loading ========== */

.skeleton {
    background: linear-gradient(90deg,
            var(--color-accent) 0%,
            var(--color-bg-secondary) 50%,
            var(--color-accent) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: var(--space-2);
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--space-3);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

.skeleton-card {
    height: 200px;
}

/* ========== Instrutor Card (Específico CNH) ========== */

.instrutor-card {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-normal);
}

.instrutor-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-4px);
}

.instrutor-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.instrutor-card-info h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

.instrutor-card-rating {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.instrutor-card-rating span {
    color: #FBBF24;
    font-weight: var(--font-semibold);
}

.instrutor-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.instrutor-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.instrutor-card-price {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-primary);
}

.instrutor-card-price span {
    font-size: var(--text-sm);
    font-weight: var(--font-regular);
    color: var(--color-text-tertiary);
}