/* style.css - Premium Brand Stylesheet for Innova Schools Court Booking System */

:root {
    --primary: #002d72;       /* Innova Deep Blue */
    --primary-light: #004094;
    --primary-dark: #001a44;
    --secondary: #78be20;     /* Innova Bright Green */
    --secondary-hover: #5fa016;
    --accent: #FFA300;        /* Innova Orange/Yellow Accent */
    --background: #f4f7fc;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text: #2c3e50;
    --text-muted: #7f8c8d;
    --border: #e2e8f0;
    --white: #ffffff;
    --success: #2ecc71;
    --error: #e74c3c;
    --shadow: 0 8px 30px rgba(0, 45, 114, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background-color: var(--background);
    background-image: radial-gradient(at 0% 0%, rgba(120, 190, 32, 0.05) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(0, 45, 114, 0.05) 0px, transparent 50%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Header */
header {
    background: rgba(0, 45, 114, 0.95);
    backdrop-filter: blur(10px);
    color: var(--white);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--primary);
    box-shadow: 0 2px 10px rgba(120, 190, 32, 0.3);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--secondary);
}

.user-nav-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.coins-badge {
    background: rgba(255, 163, 0, 0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-nav-action {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-nav-action:hover {
    background: var(--white);
    color: var(--primary);
    border-color: var(--white);
}

.btn-logout {
    background: var(--secondary);
    border: none;
    color: var(--white);
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
}

/* Container */
.container {
    max-width: 1200px;
    width: 90%;
    margin: 40px auto;
    flex: 1;
}

/* Auth Cards */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
}

.auth-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    text-align: center;
    transform: translateY(0);
    transition: var(--transition);
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 45, 114, 0.12);
}

.auth-logo {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
}

.auth-logo span {
    color: var(--secondary);
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* Forms */
.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text);
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 45, 114, 0.1);
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 45, 114, 0.2);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.sidebar-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.profile-section {
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 750;
    margin: 0 auto 15px;
}

.profile-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.profile-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.9rem;
}

.meta-item span:first-child {
    font-weight: 600;
    color: var(--text-muted);
}

.meta-item span:last-child {
    font-weight: 700;
    color: var(--primary);
}

/* Booking Cards */
.booking-wizard-card {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 750;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.court-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.court-option {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.court-option input {
    position: absolute;
    opacity: 0;
}

.court-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
    display: block;
}

.court-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}

.court-option:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
}

.court-option input:checked + .court-card-content {
    transform: scale(1.02);
}

.court-option.selected {
    border-color: var(--secondary);
    background: rgba(120, 190, 32, 0.05);
}

/* Booking Schedule Layout */
.schedule-grid-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .court-options {
        grid-template-columns: 1fr;
    }
    .schedule-grid-picker {
        grid-template-columns: 1fr;
    }
}

.day-column {
    background: var(--background);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.day-header {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(0, 45, 114, 0.1);
}

.slot-btn {
    display: block;
    width: 100%;
    padding: 10px 5px;
    margin-bottom: 8px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
}

.slot-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(0, 45, 114, 0.05);
}

.slot-btn.selected {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.slot-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* My Bookings Table */
.bookings-table-wrapper {
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 700;
    color: var(--primary);
    background: var(--background);
}

tr:hover {
    background: rgba(0, 45, 114, 0.01);
}

.badge {
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}

.badge-court-1 { background: rgba(52, 152, 219, 0.15); color: #2980b9; } /* Voley */
.badge-court-2 { background: rgba(46, 204, 113, 0.15); color: #27ae60; } /* Futbol */
.badge-court-3 { background: rgba(230, 126, 34, 0.15); color: #d35400; } /* Basquet */

.btn-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-danger:hover {
    background: var(--error);
    color: var(--white);
}

/* Prize Store Styles */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

.prize-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.prize-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 45, 114, 0.1);
}

.prize-image-placeholder {
    height: 200px;
    background: linear-gradient(135deg, rgba(0, 45, 114, 0.05), rgba(120, 190, 32, 0.05));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    position: relative;
}

.prize-cost-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(255, 163, 0, 0.3);
}

.prize-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.prize-name {
    font-size: 1.15rem;
    font-weight: 750;
    color: var(--primary);
    margin-bottom: 8px;
}

.prize-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 15px;
    flex: 1;
}

.prize-stock {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.btn-redeem {
    width: 100%;
    background: var(--secondary);
    color: var(--white);
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-redeem:hover:not(:disabled) {
    background: var(--secondary-hover);
}

.btn-redeem:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Alerts System */
.alert-box {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #e8f8f0;
    color: #27ae60;
    border: 1px solid #c2f0d5;
}

.alert-box.alert-danger {
    background: #fdf2f2;
    color: #e74c3c;
    border: 1px solid #fcdede;
}

/* Footer styling */
footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
    margin-top: auto;
    border-top: 3px solid var(--secondary);
}

/* Tablet & Mobile Responsiveness Enhancements */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
        align-items: center;
    }
    .logo-container {
        justify-content: center;
        margin-bottom: 5px;
    }
    .user-nav-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }
    .coins-badge, .btn-nav-action, .btn-logout {
        padding: 8px 12px;
        font-size: 0.85rem;
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }
    .container {
        margin: 20px auto;
        width: 95%;
    }
    .booking-wizard-card {
        padding: 15px;
    }
    .schedule-grid-picker {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .day-column {
        padding: 15px;
        background: rgba(0, 45, 114, 0.02);
        border: 1px solid var(--border);
    }
    .slot-btn {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    tr {
        border: 1px solid var(--border);
        margin-bottom: 10px;
        border-radius: 8px;
        padding: 10px;
        background: var(--white);
    }
    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50% !important;
        text-align: right;
    }
    td:last-child {
        border-bottom: none;
    }
    td:before {
        position: absolute;
        top: 14px;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
        color: var(--primary);
    }
    /* Label the td cells in responsive table - Reservas */
    .bookings-table-wrapper td:nth-of-type(1):before { content: "Cancha"; }
    .bookings-table-wrapper td:nth-of-type(2):before { content: "Fecha"; }
    .bookings-table-wrapper td:nth-of-type(3):before { content: "Horario"; }
    .bookings-table-wrapper td:nth-of-type(4):before { content: "Acción"; }

    /* Label the td cells in responsive table - Historial de canjes */
    .redemptions-table-wrapper td:nth-of-type(1):before { content: "Premio"; }
    .redemptions-table-wrapper td:nth-of-type(2):before { content: "Costo"; }
    .redemptions-table-wrapper td:nth-of-type(3):before { content: "Fecha"; }
    .redemptions-table-wrapper td:nth-of-type(4):before { content: "Estado"; }

    .bookings-table-wrapper td,
    .redemptions-table-wrapper td {
        padding: 8px 10px !important;
    }

    /* Store responsive overrides */
    .store-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .prize-info {
        padding: 14px;
    }
    .prize-name {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .user-nav-info {
        flex-direction: column;
        align-items: stretch;
    }
    .coins-badge, .btn-nav-action, .btn-logout {
        width: 100%;
        display: flex;
    }
    .auth-card {
        padding: 25px 15px;
    }
    /* Store: 1 column on small phones */
    .store-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .prize-img-wrap {
        aspect-ratio: 16/9;
    }
}

