/* ============================================
   CAMPUS VIRTUAL — Styles
   Universidad Politécnica Digital
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;600;700&display=swap');

:root {
    --upd-blue: #2B5EA7;
    --upd-blue-dark: #1A3A6C;
    --upd-blue-deeper: #0F2447;
    --upd-blue-light: #4A7EC7;
    --upd-blue-pale: #E8F0FA;
    --upd-gold: #C9A84C;
    --upd-gold-light: #E0CB7E;
    --white: #FFFFFF;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    --transition-base: 300ms ease;
    --transition-fast: 150ms ease;

    /* Theme Semantic Variables (Default: Dark) */
    --bg-primary: #0B1A30;
    --bg-header: rgba(15, 36, 71, 0.95);
    --bg-panel: rgba(15, 36, 71, 0.97);
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: var(--white);
    --text-secondary: var(--gray-400);
    --border-color: rgba(255, 255, 255, 0.08);
    --map-gradient: radial-gradient(circle at 30% 40%, rgba(43, 94, 167, 0.15) 0%, transparent 50%),
                    radial-gradient(circle at 70% 60%, rgba(201, 168, 76, 0.08) 0%, transparent 50%),
                    linear-gradient(180deg, #0B1A30 0%, #0F2447 40%, #162D56 100%);
}

/* ── Light Theme Overrides ── */
body.light-theme {
    --bg-primary: #F8FAFC;
    --bg-header: rgba(255, 255, 255, 0.95);
    --bg-panel: rgba(255, 255, 255, 0.98);
    --bg-card: var(--white);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-500);
    --border-color: var(--gray-200);
    --map-gradient: radial-gradient(circle at 30% 40%, rgba(43, 94, 167, 0.05) 0%, transparent 50%),
                    radial-gradient(circle at 70% 60%, rgba(74, 126, 199, 0.03) 0%, transparent 50%),
                    linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ============================================
   CAMPUS DASHBOARD HEADER
   ============================================ */
.campus-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
    transition: all 0.3s ease;
}

.campus-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.campus-logo-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.campus-logo-mini svg {
    width: 36px;
    height: 36px;
}

.campus-logo-mini span {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.campus-badge {
    background: rgba(201, 168, 76, 0.15);
    border: 1px solid rgba(201, 168, 76, 0.3);
    color: var(--upd-gold);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.campus-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-400);
    transition: all var(--transition-base);
    position: relative;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
}

.header-icon-btn .notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid var(--upd-blue-deeper);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all var(--transition-base);
}

.user-menu:hover {
    background: rgba(255, 255, 255, 0.12);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--upd-blue), var(--upd-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 0.8rem;
}

.user-name {
    font-size: 0.85rem;
    color: var(--gray-300);
    font-weight: 500;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    font-family: var(--font-sans);
}

.logout-btn:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   MAIN CAMPUS MAP AREA
   ============================================ */
.campus-main {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: var(--map-gradient);
    transition: background 0.5s ease;
}

.campus-map-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.campus-map-title {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.campus-map-title h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--white);
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.campus-map-title p {
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

/* Dynamic Campus Image */
.campus-dynamic-wrapper {
    width: 95%;
    max-width: 1400px;
    height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    background: rgba(11, 26, 48, 0.3);
    backdrop-filter: blur(5px);
}

.campus-dynamic-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 1.5s ease-in-out, transform 0.5s ease;
}

.campus-dynamic-image:hover {
    transform: scale(1.02);
}

/* OVERLAY PINS */
.interactive-pin {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.pin-icon {
    width: 36px;
    height: 36px;
    background: rgba(15, 36, 71, 0.85);
    border: 2px solid var(--upd-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    animation: pinPulse 2s infinite;
    transition: all 0.3s ease;
}

.pin-label {
    margin-top: 0.4rem;
    background: rgba(15, 36, 71, 0.9);
    color: var(--white);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.interactive-pin:hover .pin-icon {
    transform: scale(1.15);
    background: var(--upd-gold);
    border-color: var(--white);
    animation: none;
}

.interactive-pin:hover .pin-label {
    opacity: 1;
    transform: translateY(0);
}

@keyframes pinPulse {
    0% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.6); }
    70% { box-shadow: 0 0 0 12px rgba(201, 168, 76, 0); }
    100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0); }
}

/* ============================================
   INFO SIDEBAR PANEL
   ============================================ */
.info-panel {
    position: fixed;
    top: 64px;
    right: -420px;
    width: 400px;
    height: calc(100vh - 64px);
    background: var(--bg-panel);
    backdrop-filter: blur(30px);
    border-left: 1px solid var(--border-color);
    z-index: 50;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}

.info-panel.open {
    right: 0;
}

.info-panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.info-panel-header h3 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.info-panel-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.info-panel-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.3);
}

.info-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.info-panel-body::-webkit-scrollbar {
    width: 4px;
}

.info-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.info-panel-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.info-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.info-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.info-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.info-feature:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(201, 168, 76, 0.2);
}

.info-feature-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: var(--radius-sm);
    background: rgba(43, 94, 167, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.info-feature-text {
    flex: 1;
}

.info-feature-text strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.info-feature-text span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.info-panel-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.info-panel-status.online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.info-panel-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: status-blink 2s ease-in-out infinite;
}

@keyframes status-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.info-action-btn {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--upd-blue), var(--upd-blue-dark));
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-base);
}

.info-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(43, 94, 167, 0.4);
}

/* Info panel schedule */
.info-schedule {
    margin-top: 1.5rem;
}

.info-schedule h4 {
    font-size: 0.85rem;
    color: var(--gray-400);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.85rem;
}

.schedule-item .day {
    color: var(--gray-300);
    font-weight: 500;
}

.schedule-item .time {
    color: var(--gray-500);
}

/* Map Legend Removed */

/* ============================================
   MINI QUICK ACTIONS
   ============================================ */
.quick-actions {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.quick-action-btn {
    padding: 0.6rem 1rem;
    background: rgba(15, 36, 71, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--gray-400);
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-sans);
}

.quick-action-btn:hover {
    background: rgba(43, 94, 167, 0.3);
    color: var(--white);
    border-color: rgba(43, 94, 167, 0.5);
}

/* ============================================
   WELCOME OVERLAY (on first load)
   ============================================ */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 26, 48, 0.95);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.8s ease;
}

.welcome-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.welcome-content {
    text-align: center;
    animation: welcome-enter 0.8s ease;
}

@keyframes welcome-enter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

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

.welcome-content h1 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.welcome-content h1 .gold {
    color: var(--upd-gold-light);
}

.welcome-content p {
    color: var(--gray-400);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.welcome-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(201, 168, 76, 0.2);
    border-top-color: var(--upd-gold);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .campus-header {
        padding: 0 1rem;
    }

    .campus-badge {
        display: none;
    }

    .user-name {
        display: none;
    }

    .info-panel {
        width: 100%;
        right: -100%;
    }

    .map-legend {
        display: none;
    }

    .campus-map-title h2 {
        font-size: 1.2rem;
    }

    .campus-map-title p {
        font-size: 0.75rem;
    }

    .quick-actions {
        bottom: 1rem;
        right: 1rem;
    }
}