/* =========================================
   ALUNO DASHBOARD - MOBILE FIRST
   ========================================= */

/* === BASE STYLES (MOBILE) === */
.aluno-dashboard-wrapper {
    background-color: #f4f6f9;
}

.aluno-dashboard-wrapper .content-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #343a40;
}

/* Alerts Container */
.alerts-container {
    margin-bottom: 1rem;
}

.alerts-container .alert {
    border-radius: 0.5rem;
    border-left: 4px solid;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    font-weight: 500;
}

.alerts-container .alert-danger {
    border-left-color: #bd2130;
    background-color: #f5c2c7;
    color: #721c24;
}

.alerts-container .alert-danger strong {
    color: #5a1620;
}

.alerts-container .alert-warning {
    border-left-color: #d39e00;
    background-color: #ffe69c;
    color: #856404;
}

.alerts-container .alert-warning strong {
    color: #6c4d03;
}

.alerts-container .alert-info {
    border-left-color: #117a8b;
    background-color: #b8daff;
    color: #0c5460;
}

.alerts-container .alert-info strong {
    color: #083c45;
}

.alerts-container .alert i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Week Navigation */
.week-navigation {
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.week-navigation .card-body {
    padding: 1rem;
}

.week-navigation .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    min-width: 100px;
}

.week-navigation .week-range h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

.week-navigation .week-range small {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #007bff;
}

/* Training Cards */
.training-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.training-day-card {
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
}

.training-day-card.today {
    border-left: 4px solid #007bff;
    box-shadow: 0 3px 8px rgba(0,123,255,0.2);
}

.training-day-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
}

.training-day-card .card-header h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.training-day-card .card-body {
    padding: 1rem;
}

/* Training Item */
.training-item {
    background-color: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.training-item:last-child {
    margin-bottom: 0;
}

.training-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.training-header {
    padding: 0.875rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    user-select: none;
}

.training-header .training-info {
    flex: 1;
    min-width: 0;
}

.training-header .training-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.training-header .training-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.training-header .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.375rem;
}

.training-header .toggle-icon {
    color: #6c757d;
    transition: transform 0.3s ease;
    font-size: 0.875rem;
}

.training-header.active .toggle-icon {
    transform: rotate(180deg);
}

/* Training Details */
.training-details {
    padding: 0 1rem 1.5rem;
    animation: slideDown 0.3s ease;
}

.training-details hr {
    margin: 0 0 1rem;
    border-top-color: #e3e6f0;
}

.detail-section {
    margin-bottom: 1rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #495057;
    font-size: 0.9rem;
}

.detail-section strong i {
    margin-right: 0.375rem;
    color: #6c757d;
}

.detail-section p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Feedback Section */
.feedback-section {
    background-color: #f8f9fa;
    padding: 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid #e3e6f0;
}

.feedback-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.feedback-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.feedback-stats span i {
    color: #007bff;
    font-size: 0.85rem;
}

.coach-comment {
    background-color: #fff;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border-left: 3px solid #007bff;
}

.coach-comment strong {
    margin-bottom: 0.5rem;
}

.coach-comment p {
    color: #2c3e50;
}

/* Action Buttons */
.training-details .text-center .btn {
    margin: 0 0.25rem 0.5rem 0.25rem;
    white-space: nowrap;
}

.training-details .text-center {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

/* Mobile: Stack buttons vertically */
@media (max-width: 576px) {
    .training-details .text-center {
        flex-direction: column;
        align-items: stretch;
    }

    .training-details .text-center .btn {
        width: 100%;
        margin: 0.25rem 0;
    }
}

/* No Training State */
.no-training {
    padding: 2rem 1rem !important;
}

.no-training i {
    color: #adb5bd;
    opacity: 0.6;
}

.no-training p {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Summary Sidebar */
.sidebar-content {
    margin-top: 1rem;
}

.summary-sidebar .summary-content {
    display: block;
}

.summary-sidebar .card {
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border: 1px solid #dee2e6;
}

.summary-sidebar .card-header {
    background-color: #007bff;
    color: #fff;
    padding: 0.875rem 1rem;
    border-bottom: none;
}

.summary-sidebar .card-header h5 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-sidebar .card-body {
    padding: 1rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid #e3e6f0;
}

.summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-item:first-child {
    padding-top: 0;
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 1.25rem;
}

.summary-icon.bg-info {
    background-color: #17a2b8;
}

.summary-icon.bg-danger {
    background-color: #dc3545;
}

.summary-icon.bg-success {
    background-color: #28a745;
}

.summary-icon.bg-warning {
    background-color: #ffc107;
    color: #495057;
}

.summary-details {
    flex: 1;
    min-width: 0;
}

.summary-details small {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.summary-details h6 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

/* === TREINO PROPOSTO (PASSOS) === */
.treino-proposto {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.treino-resultado {
    background-color: #e8f5e9;
    border: 1px solid #81c784;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Remove margem do último elemento dentro dos detalhes */
.training-details > .treino-proposto:last-child,
.training-details > .treino-resultado:last-child,
.training-details > .alert:last-child {
    margin-bottom: 0;
}

.treino-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.treino-passos {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.passo-item {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.passo-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.passo-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.passo-numero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: #007bff;
    color: #fff;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.passo-tipo {
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.passo-detalhes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 2.5rem;
}

.passo-info {
    font-size: 0.875rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.passo-info i {
    color: #007bff;
    font-size: 0.85rem;
    width: 16px;
}

.passo-info strong {
    color: #495057;
}

.passo-info em {
    color: #6c757d;
    font-style: italic;
}

.passo-info .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Repetições */
.repeticoes-container {
    background-color: #f8f9fa;
    border-left: 3px solid #ffc107;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    margin-top: 0.5rem;
}

.repeticoes-header {
    font-weight: 600;
    font-size: 0.875rem;
    color: #856404;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.passo-repeticao {
    font-size: 0.85rem;
    color: #6c757d;
    padding: 0.25rem 0 0.25rem 1.5rem;
    position: relative;
}

.passo-repeticao::before {
    content: "•";
    position: absolute;
    left: 0.5rem;
    color: #ffc107;
    font-weight: bold;
}

.passo-rep-tipo {
    font-weight: 500;
    color: #495057;
}

/* Badge de Treino Atrasado */
.training-badges .badge-danger {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* === EVENT ITEMS === */
.event-item {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid #fb923c;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: 0 3px 8px rgba(251, 146, 60, 0.15);
    transition: all 0.3s ease;
}

.event-item:last-child {
    margin-bottom: 0;
}

.event-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.25);
    border-color: #f97316;
}

.event-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(251, 146, 60, 0.3);
}

.event-content {
    flex: 1;
    min-width: 0;
}

.event-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #c2410c;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-description {
    font-size: 0.9rem;
    color: #9a3412;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.event-distance {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ea580c;
    background-color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    border: 1px solid #fed7aa;
    margin-top: 0.5rem;
}

.event-distance i {
    font-size: 0.85rem;
}

/* Event on today's card */
.training-day-card.today .event-item {
    border-color: #f97316;
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.3);
}

/* Mobile adjustments for events */
@media (max-width: 576px) {
    .event-item {
        padding: 0.875rem;
        gap: 0.75rem;
    }

    .event-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .event-title {
        font-size: 1rem;
    }
}

/* === TABLET (768px+) === */
@media (min-width: 768px) {
    .aluno-dashboard-wrapper .content-header h1 {
        font-size: 1.75rem;
    }

    .week-navigation .week-range h5 {
        font-size: 1.25rem;
    }

    .training-header .training-title {
        font-size: 1.05rem;
    }

    .feedback-stats {
        gap: 1.5rem;
    }

    .sidebar-content {
        margin-top: 0;
    }

    .summary-sidebar .summary-content {
        display: block !important; /* Override inline JS on desktop */
    }
}

/* === DESKTOP (1024px+) === */
@media (min-width: 1024px) {
    .aluno-dashboard-wrapper .content-header h1 {
        font-size: 2rem;
    }

    .main-content {
        padding-right: 1.5rem;
    }

    .sidebar-content .btn {
        display: none; /* Hide toggle button on desktop */
    }

    .summary-sidebar {
        position: sticky;
        top: 20px;
    }

    .training-cards {
        gap: 1.25rem;
    }

    .training-day-card {
        transition: all 0.3s ease, transform 0.2s ease;
    }

    .training-day-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    }
}

/* === UTILITY CLASSES === */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Week Loading Spinner */
.week-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.week-range {
    position: relative;
}

.week-nav-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animação de fade para transição dos cards */
#training-cards-container {
    transition: opacity 0.3s ease;
}

#training-cards-container.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Print Styles */
@media print {
    .week-navigation .btn,
    .alerts-container .close,
    .summary-sidebar .btn {
        display: none !important;
    }

    .training-day-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .training-details {
        display: block !important;
    }
}
