/**
 * =====================================================
 * ONBOARDS STYLES - Sistema KartOps
 * =====================================================
 * Mobile First Design
 */

/* Container principal */
.onboards-wrapper {
    padding: 20px 15px;
    padding-top: 120px;
    /* Espaço para o header fixo */
    padding-bottom: 100px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header da página */
.onboards-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.onboards-header .header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.onboards-header h1 {
    font-size: 1.5rem;
    color: #f7fafc;
    margin: 0;
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Botão adicionar */
.btn-add-onboard {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #e53935, #c62828);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
}

.btn-add-onboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.4);
}

.btn-add-onboard:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Mensagem de aviso (sem piloto vinculado) */
.warning-message {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border: 1px solid #ffc107;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.warning-message .icon {
    font-size: 2rem;
}

.warning-message .text h3 {
    margin: 0 0 5px 0;
    color: #856404;
    font-size: 1.1rem;
}

.warning-message .text p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
}

/* Grid de onboards (container externo) */
.onboards-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Seção por etapa */
.etapa-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Cabeçalho da seção */
.etapa-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.etapa-section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.etapa-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.etapa-section-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.etapa-section-nome {
    font-weight: 700;
    font-size: 0.9rem;
    color: #f0f0f0;
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.etapa-section-data {
    font-size: 0.8rem;
    color: #a0a0a0;
    flex-shrink: 0;
}

/* Grid interno de cards por etapa */
.onboards-grid-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .onboards-grid-inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .onboards-grid-inner {
        grid-template-columns: repeat(3, 1fr);
    }
}




/* Card de onboard */
.onboard-card {
    background: #27282b;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: all 0.3s ease;
}

.onboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Video container */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Info do card */
.onboard-info {
    padding: 15px;
}

.onboard-title {
    font-size: 1rem;
    font-weight: 600;
    color: #f0f0f0;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.onboard-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    color: #a0a0a0;
}

.onboard-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.onboard-meta .meta-icon {
    width: 20px;
    text-align: center;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-categoria {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.badge-etapa {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Ações do card */
.onboard-actions {
    display: flex;
    justify-content: flex-end;
    padding: 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.btn-delete-onboard {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #fff5f5;
    color: #e53935;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete-onboard:hover {
    background: #ffebee;
    border-color: #e53935;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #27282b;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #e0e0e0;
    margin: 0 0 10px 0;
}

.empty-state p {
    color: #a0a0a0;
    margin: 0;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: #1e1f22;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #f0f0f0;
}

.btn-close-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.modal-body {
    padding: 20px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #d0d0d0;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.06);
    color: #f0f0f0;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group .help-text {
    margin-top: 5px;
    font-size: 0.8rem;
    color: #a0a0a0;
}

/* Preview do vídeo no formulário */
.video-preview {
    margin-top: 15px;
    border-radius: 10px;
    overflow: hidden;
    background: #f7f7f7;
    display: none;
}

.video-preview.active {
    display: block;
}

.video-preview .preview-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
}

.video-preview iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-preview .preview-title {
    padding: 10px 15px;
    font-size: 0.9rem;
    color: #2d3748;
    background: #e8f5e9;
    border-top: 1px solid #c8e6c9;
}

.video-preview .preview-title strong {
    color: #2e7d32;
}

/* Categoria display */
.categoria-display {
    padding: 12px 15px;
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border: 2px solid #667eea30;
    border-radius: 10px;
    color: #4a5568;
    font-weight: 500;
}

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #e53935, #c62828);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.3);
}

.btn-submit:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Filtros */
.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: #27282b;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: #a0a0a0;
    font-weight: 500;
}

.filter-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.06);
    color: #f0f0f0;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

.loading-spinner::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    animation: toastSlideIn 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.toast.success {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
}

.toast.error {
    background: linear-gradient(135deg, #e53935, #c62828);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Piloto info no card */
.piloto-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.piloto-foto {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    /* Foca no rosto para fotos de corpo inteiro */
    border: 2px solid rgba(255, 255, 255, 0.2);
}