:root {
    --negro: #0a0a0a;
    --negro-card: #151515;
    --negro-hover: #1c1c1c;
    --naranja: #ff6600;
    --naranja-glow: rgba(255, 102, 0, 0.3);
    --texto-principal: #ffffff;
    --texto-secundario: #a0a0a0;
    --error: #ff4444;
    --success: #00c851;
    --sidebar-w: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--negro);
    color: var(--texto-principal);
    min-height: 100vh;
}

/* --- Auth View --- */
#auth-view {
    display: none;
    height: 100vh;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1a100a 0%, #0a0a0a 100%);
}

.auth-card {
    background: var(--negro-card);
    padding: 50px;
    border-radius: 32px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    border: 1px solid #222;
}

.logo {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    margin-bottom: 40px;
}

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

input {
    width: 100%;
    padding: 15px 20px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 14px;
    color: white;
    margin-bottom: 20px;
    font-size: 1rem;
}

.btn-primary {
    background: var(--naranja);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    text-transform: uppercase;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--naranja-glow);
}

/* --- Main Layout --- */
#main-view {
    display: none;
    width: 100%;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--negro-card);
    border-right: 1px solid #222;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.nav-item {
    padding: 16px 20px;
    margin-bottom: 10px;
    border-radius: 14px;
    color: var(--texto-secundario);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    transition: 0.3s;
}

.nav-item:hover,
.nav-item.active {
    background: var(--negro-hover);
    color: white;
}

.nav-item.active {
    background: var(--naranja);
    color: white;
    box-shadow: 0 8px 20px var(--naranja-glow);
}

.content {
    margin-left: var(--sidebar-w);
    padding: 50px;
    max-width: 1200px;
    width: calc(100% - var(--sidebar-w));
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.user-pill {
    background: var(--negro-card);
    padding: 10px 25px;
    border-radius: 40px;
    border: 1px solid #222;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.mobile-logout {
    display: none;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--naranja);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

/* --- Hamburger & Overlay --- */
.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 45px;
    height: 45px;
    background: #1a1a1a;
    border-radius: 12px;
    justify-content: center;
    align-items: center;
    border: 1px solid #333;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 999;
}

/* --- Responsive Mobile --- */
@media (max-width: 900px) {
    .hamburger { display: flex; }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px !important;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0 30px 30px 0;
        border-right: 1px solid #222;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .sidebar.sidebar-open ~ .sidebar-overlay {
        display: block !important;
    }

    .sidebar .logo {
        display: block;
        margin-bottom: 40px;
    }

    .nav-item {
        padding: 15px 20px;
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .content {
        margin-left: 0;
        padding: 15px;
        width: 100% !important;
    }

    .header {
        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;
        margin-bottom: 25px;
        padding-top: 10px;
    }

    .header h1 {
        font-size: 1.4rem;
        flex: 1;
        text-align: left;
    }

    .user-pill span#user-name {
        display: none;
    }

    /* Mostrar botón de cerrar sesión en el header en móvil */
    .mobile-logout {
        display: flex !important;
        background: rgba(255, 68, 68, 0.1);
        color: var(--error);
        width: 40px;
        height: 40px;
        border-radius: 12px;
        justify-content: center;
        align-items: center;
        font-size: 1.2rem;
        border: 1px solid rgba(255, 68, 68, 0.2);
    }

    .day-tabs {
        gap: 8px;
        padding: 5px 0;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100vw;
        margin-bottom: 25px;
    }

    .day-tab {
        min-width: 100px;
        padding: 12px;
        flex-shrink: 0;
    }

    .day-name {
        font-size: 0.85rem;
    }

    .clases-grid {
        grid-template-columns: 1fr !important;
        width: 100%;
        gap: 15px;
    }

    /* Responsive para tablas/reservas */
    .table-res thead {
        display: none;
    }

    .table-res tr {
        display: block;
        background: #1a1a1a;
        margin-bottom: 15px;
        border-radius: 16px;
        padding: 15px;
        border: 1px solid #333;
    }

    .table-res td {
        display: block;
        text-align: right;
        border: none;
        padding: 8px 0;
        font-size: 0.9rem;
    }

    .table-res td::before {
        content: attr(data-label);
        float: left;
        font-weight: 800;
        color: var(--texto-secundario);
        text-transform: uppercase;
        font-size: 0.7rem;
    }

    .table-res td:last-child {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 10px;
        border-top: 1px solid #222;
        padding-top: 15px;
    }

    .table-res td:last-child::before {
        display: none;
    }

    .res-status-container {
        flex-direction: column !important;
        gap: 8px;
        width: 100%;
        align-items: center;
    }
}

/* --- Tabs Calendario --- */
.day-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.day-tab {
    padding: 15px 25px;
    background: var(--negro-card);
    border-radius: 16px;
    cursor: pointer;
    border: 1px solid #222;
    min-width: 120px;
    text-align: center;
    transition: 0.3s;
}

.day-tab:hover {
    background: var(--negro-hover);
}

.day-tab.active {
    border-color: var(--naranja);
    background: rgba(255, 102, 0, 0.05);
}

.day-tab.active .day-name {
    color: var(--naranja);
}

.day-name {
    display: block;
    font-weight: 800;
    font-size: 1.1rem;
}

.day-date {
    font-size: 0.75rem;
    color: var(--texto-secundario);
    font-weight: 600;
    text-transform: uppercase;
}

/* --- Grid Clases --- */
.clases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.clase-card {
    background: var(--negro-card);
    padding: 30px;
    border-radius: 24px;
    border: 1px solid #222;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.clase-card:hover {
    transform: translateY(-5px);
    border-color: #333;
}

.clase-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 15px;
}

.clase-meta {
    color: var(--texto-secundario);
    font-size: 0.9rem;
    margin-bottom: 25px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.clase-meta i {
    color: var(--naranja);
    margin-right: 8px;
}

.ocupacion-bar {
    height: 6px;
    background: #222;
    border-radius: 10px;
    margin-bottom: 25px;
    overflow: hidden;
}

.ocupacion-fill {
    height: 100%;
    background: var(--naranja);
    border-radius: 10px;
    transition: 1s;
}

.btn-cancel {
    background: rgba(255, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(255, 68, 68, 0.2);
}

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

/* --- Perfil & Reservas --- */
.card {
    background: var(--negro-card);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid #222;
    margin-bottom: 30px;
}

.table-res {
    width: 100%;
    border-collapse: collapse;
}

.table-res th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid #222;
    color: var(--texto-secundario);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.table-res td {
    padding: 15px;
    border-bottom: 1px solid #222;
}

.res-status-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal {
    background: var(--negro-card);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    border: 1px solid #333;
}

/* --- Badges --- */
.badge {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-success { 
    background: rgba(0, 200, 81, 0.1); 
    color: var(--success); 
    border: 1px solid rgba(0, 200, 81, 0.2); 
}
.badge-error { 
    background: rgba(255, 68, 68, 0.1); 
    color: var(--error); 
    border: 1px solid rgba(255, 68, 68, 0.2); 
}
.badge-warning { 
    background: rgba(255, 102, 0, 0.1); 
    color: var(--naranja); 
    border: 1px solid rgba(255, 102, 0, 0.2); 
}

/* --- Notifications Area --- */
.notification-area {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.flash-notice {
    background: var(--negro-card);
    border: 1px solid #333;
    border-left: 5px solid var(--naranja);
    padding: 25px;
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
    color: white;
    width: 380px;
    pointer-events: all;
    animation: slideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    backdrop-filter: blur(20px);
}

.flash-notice h4 {
    color: var(--texto-secundario);
    margin-bottom: 20px;
    font-weight: 900;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #222;
    padding-bottom: 10px;
}

.notice-card {
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.notice-card .clase-nom {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--naranja);
    margin-bottom: 8px;
}

.notice-card .info-row {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--texto-secundario);
}

.notice-card .info-row i {
    color: var(--naranja);
    margin-right: 5px;
}

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.flash-notice.fade-out {
    animation: slideOut 0.5s ease forwards;
}
/* --- Bike Selection Modal --- */
.bike-modal {
    max-width: 900px !important;
    width: 95% !important;
    padding: 30px !important;
    position: relative;
}

.bike-selection-container {
    background: #0a0a0a; /* Fondo ultra oscuro */
    border-radius: 24px;
    padding: 15px;
    margin: 20px 0;
    overflow: auto;
    display: flex;
    justify-content: center;
    border: 1px solid #1a1a1a;
    max-height: 70vh;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}

.bike-selection-container svg {
    width: 100%;
    height: auto;
    max-width: 800px;
}

/* Colores de las bicis */
.bike-container { cursor: pointer; transition: transform 0.2s ease; }
.bike-container:hover { transform: scale(1.05); }

/* Libre: Verde Esmeralda Premium */
.bike-container .bike-shape { 
    stroke: #00ff88; 
    stroke-width: 3; 
    filter: drop-shadow(0 0 2px rgba(0, 255, 136, 0.3));
    transition: all 0.3s ease;
}
.bike-container .bike-bg { 
    fill: rgba(0, 255, 136, 0.03); 
    stroke: rgba(0, 255, 136, 0.1);
    stroke-width: 1;
}
.bike-container text { 
    fill: #ffffff; 
    font-weight: 900; 
    font-size: 16px; 
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
    display: block !important; 
    opacity: 1 !important;
}

/* Ocupada: Rojo Intenso */
.bike-container.occupied { cursor: not-allowed; }
.bike-container.occupied .bike-shape { stroke: #ff3333; stroke-width: 2; opacity: 0.6; }
.bike-container.occupied .bike-bg { fill: rgba(255, 51, 51, 0.05); }
.bike-container.occupied text { fill: #ff3333; opacity: 0.5; }

/* Bloqueada: Gris Carbón */
.bike-container.blocked { cursor: not-allowed; }
.bike-container.blocked .bike-shape { stroke: #444; opacity: 0.5; }
.bike-container.blocked .bike-bg { fill: #1a1a1a; }
.bike-container.blocked text { fill: #444; }

/* Seleccionada: Naranja Eléctrico (Glow) */
.bike-container.selected .bike-shape { 
    stroke: var(--naranja); 
    stroke-width: 5;
    filter: drop-shadow(0 0 12px var(--naranja));
}
.bike-container.selected .bike-bg { 
    fill: rgba(255, 102, 0, 0.2); 
    stroke: var(--naranja);
}
.bike-container.selected text { 
    fill: var(--naranja); 
    font-size: 18px;
    filter: drop-shadow(0 0 5px var(--naranja-glow));
}

.bike-container:hover:not(.occupied):not(.blocked) .bike-shape {
    stroke: var(--naranja);
    stroke-width: 3.5;
}

.bike-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--texto-secundario);
}

.legend-item { display:flex; align-items:center; gap:8px; }
.legend-dot { width:12px; height:12px; border-radius:50%; }

.dot-free { background: var(--success); border: 1px solid rgba(255,255,255,0.2); }
.dot-occupied { background: var(--error); }
.dot-blocked { background: #444; }
.dot-selected { background: var(--naranja); box-shadow: 0 0 10px var(--naranja-glow); }

@media (max-width: 600px) {
    .bike-modal { padding: 15px !important; }
    .bike-selection-container { padding: 5px; }
    .bike-legend { flex-wrap: wrap; gap: 10px; }
}
