/**
 * User Reservations Dashboard Styling
 * Modern, polished appearance with accordion for past reservations
 */

/* ==========================================
   WRAPPER & CONTAINER
   ========================================== */

.user-reservations-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ==========================================
   LOGIN PROMPT (Not Logged In State)
   ========================================== */

.user-reservations-login-prompt {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 500px;
    margin: 40px auto;
}

.login-prompt-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.user-reservations-login-prompt h3 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.user-reservations-login-prompt p {
    font-size: 16px;
    color: #6c757d;
    margin: 0 0 30px 0;
    line-height: 1.6;
}

.login-button {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #1e73be 0%, #0e5a8f 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(30, 115, 190, 0.3);
}

.login-button:hover {
    background: linear-gradient(135deg, #0e5a8f 0%, #0a4a7a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 115, 190, 0.4);
    color: #ffffff;
    text-decoration: none;
}

/* ==========================================
   EMPTY STATE (No Reservations)
   ========================================== */

.user-reservations-empty {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px dashed #dee2e6;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    max-width: 500px;
    margin: 40px auto;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.user-reservations-empty h3 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.user-reservations-empty p {
    font-size: 16px;
    color: #6c757d;
    margin: 0 0 30px 0;
    line-height: 1.6;
}

.reserve-button {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #28a745 0%, #1e8635 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.reserve-button:hover {
    background: linear-gradient(135deg, #1e8635 0%, #176e2a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    color: #ffffff;
    text-decoration: none;
}

/* ==========================================
   RESERVATIONS HEADER
   ========================================== */

.reservations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 25px 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
    gap: 15px;
}

.reservations-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.reservations-count {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.upcoming-count,
.past-count {
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
}

.upcoming-count {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.past-count {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #495057;
    border: 1px solid #dee2e6;
}

/* ==========================================
   SECTION TITLES
   ========================================== */

.reservations-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 3px solid #e9ecef;
}

.section-icon {
    font-size: 28px;
}

/* ==========================================
   RESERVATIONS GRID
   ========================================== */

.reservations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}

/* ==========================================
   RESERVATION CARDS
   ========================================== */

.reservation-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 18px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 5px solid #dee2e6;
    border: 2px solid #e9ecef;
    border-left: 5px solid #dee2e6;
    position: relative;
}

/* Alternating background colors for better separation */
.reservation-card:nth-child(odd) {
    background: #ffffff;
}

.reservation-card:nth-child(even) {
    background: #fafbfc;
}

.reservation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, currentColor 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reservation-card:hover::before {
    opacity: 0.3;
}

.reservation-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* Card Header */
.card-header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 19px;
}

.court-icon {
    font-size: 28px;
}

.court-name {
    color: #2c3e50;
}

/* Card Body */
.card-body {
    padding: 24px;
}

.reservation-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 8px 0;
}

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

.detail-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.detail-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 75px;
    font-size: 14px;
}

.detail-value {
    color: #2c3e50;
    font-weight: 600;
    font-size: 15px;
}

/* Card Footer */
.card-footer {
    padding: 14px 24px;
    background: #f1f3f5;
    border-top: 1px solid #e9ecef;
}

.calendar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1e73be;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.calendar-link:hover {
    color: #0e5a8f;
    gap: 10px;
}

/* ==========================================
   COURT-SPECIFIC STYLING
   ========================================== */

/* Yellow Court */
.reservation-card.court-yellow {
    border-left-color: #f6bf26;
}

.reservation-card.court-yellow .card-header {
    background: linear-gradient(135deg, #fff9e6 0%, #fffcf0 100%);
}

.reservation-card.court-yellow::before {
    color: #f6bf26;
}

.reservation-card.court-yellow:hover {
    box-shadow: 0 12px 30px rgba(246, 191, 38, 0.15);
}

/* Blue Court */
.reservation-card.court-blue {
    border-left-color: #4285f4;
}

.reservation-card.court-blue .card-header {
    background: linear-gradient(135deg, #e8f1ff 0%, #f0f6ff 100%);
}

.reservation-card.court-blue::before {
    color: #4285f4;
}

.reservation-card.court-blue:hover {
    box-shadow: 0 12px 30px rgba(66, 133, 244, 0.15);
}

/* ==========================================
   PAST RESERVATIONS STYLING
   ========================================== */

.reservation-card.past {
    opacity: 0.7;
    border-left-color: #adb5bd;
}

.reservation-card.past .card-header {
    background: linear-gradient(135deg, #f1f3f5 0%, #f8f9fa 100%);
}

.reservation-card.past:hover {
    opacity: 0.85;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.reservation-card.past .detail-value,
.reservation-card.past .court-name {
    color: #6c757d;
}

.reservation-card.past {
    border-color: #dee2e6;
}

/* ==========================================
   ACCORDION FOR PAST RESERVATIONS
   ========================================== */

.past-reservations-accordion {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px dashed #dee2e6;
}

.past-accordion-toggle {
    width: 100%;
    padding: 18px 28px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 17px;
    font-weight: 600;
    color: #495057;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.past-accordion-toggle:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.past-accordion-toggle:active {
    transform: translateY(0);
}

.toggle-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
    color: #6c757d;
}

.past-accordion-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(90deg);
}

.toggle-text {
    flex: 1;
    text-align: left;
}

/* Accordion Content */
.past-accordion-content {
    margin-top: 24px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .user-reservations-wrapper {
        padding: 20px 15px;
    }

    .reservations-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .reservations-header h2 {
        font-size: 28px;
    }

    .reservations-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-title {
        font-size: 22px;
    }

    .user-reservations-login-prompt,
    .user-reservations-empty {
        padding: 40px 30px;
    }

    .login-prompt-icon,
    .empty-icon {
        font-size: 48px;
    }

    .past-accordion-toggle {
        font-size: 16px;
        padding: 16px 22px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .user-reservations-wrapper {
        padding: 15px 10px;
    }

    .reservations-header {
        padding: 16px;
    }

    .reservations-header h2 {
        font-size: 24px;
    }

    .section-title {
        font-size: 20px;
    }

    .reservation-card .card-header {
        font-size: 17px;
        padding: 16px 18px;
    }

    .reservation-card .card-body {
        padding: 18px;
    }

    .reservation-detail {
        font-size: 14px;
        gap: 10px;
    }

    .detail-label {
        min-width: 65px;
        font-size: 13px;
    }

    .detail-value {
        font-size: 14px;
    }

    .user-reservations-login-prompt h3,
    .user-reservations-empty h3 {
        font-size: 24px;
    }

    .user-reservations-login-prompt p,
    .user-reservations-empty p {
        font-size: 15px;
    }

    .login-button,
    .reserve-button {
        padding: 12px 24px;
        font-size: 15px;
    }

    .reservations-count {
        width: 100%;
    }

    .upcoming-count,
    .past-count {
        flex: 1;
        text-align: center;
        font-size: 13px;
        padding: 8px 14px;
    }

    .past-accordion-toggle {
        font-size: 15px;
        padding: 14px 18px;
        gap: 10px;
    }
}

/* Small phones (360px and below) */
@media (max-width: 360px) {
    .reservations-grid {
        gap: 16px;
    }

    .reservation-card .card-header {
        padding: 14px 16px;
        font-size: 16px;
    }

    .reservation-card .card-body {
        padding: 16px;
    }

    .detail-icon {
        font-size: 18px;
        width: 24px;
    }

    .court-icon {
        font-size: 24px;
    }

    .calendar-link {
        font-size: 13px;
    }

    .section-title {
        font-size: 18px;
    }

    .section-icon {
        font-size: 22px;
    }
}
