/* Import Inter font for body text */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --nexus-navy: #22233F;
    --nexus-gold: #D3AE35;
    --nexus-white: #ffffff;
    --nexus-bg: #F5F5F7;
}

/* Animations */
@keyframes nexusFadeSlideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes nexusImageReveal {
    from { opacity: 0; filter: blur(8px); }
    to { opacity: 1; filter: blur(0); }
}

#nexus-app-container {
    font-family: 'Inter', sans-serif;
    background-color: var(--nexus-bg);
    padding: 20px;
    border-radius: 0 !important; /* SHARP EDGE */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    height: 80vh; 
    min-height: 600px;
    letter-spacing: 0.015em; /* Added base character spacing */
}

/* Headings Custom Font & Spacing */
.nexus-sidebar-title,
.nexus-viewer-title h2,
.nexus-item-title {
    font-family: 'custom font', 'Inter', sans-serif !important;
    letter-spacing: 0.03em; /* Character spacing for professional look */
}

/* Flex Container */
.nexus-layout {
    display: flex;
    gap: 20px;
    height: 100%; 
}

/* Sidebar */
.nexus-sidebar {
    width: 320px;
    background-color: var(--nexus-navy);
    color: white;
    border-radius: 0 !important; /* SHARP EDGE */
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.nexus-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nexus-sidebar-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
    color: white !important;
}

.nexus-plan-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* List Items with staggered animation */
.nexus-plan-item {
    padding: 15px;
    margin-bottom: 8px;
    border-radius: 0 !important; /* SHARP EDGE */
    cursor: pointer;
    background: rgba(255,255,255,0.05);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent;
    opacity: 0; 
    animation: nexusFadeSlideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.nexus-plan-item:hover {
    background: rgba(255,255,255,0.1);
}

.nexus-plan-item.active {
    background: linear-gradient(135deg, var(--nexus-gold), #b39225);
    color: var(--nexus-navy);
    box-shadow: 0 4px 10px rgba(211, 174, 53, 0.3);
}

.nexus-item-title {
    font-weight: bold;
    font-size: 15px;
    display: block;
    color: inherit;
    letter-spacing: 0.02em; /* Added spacing */
}

.nexus-item-sub {
    font-size: 11px;
    opacity: 0.8;
    color: inherit;
    display: block;
    margin-top: 2px;
    letter-spacing: 0.01em; /* Added spacing */
}

/* Viewer Area */
.nexus-viewer {
    flex: 1;
    background: var(--nexus-white);
    border-radius: 0 !important; /* SHARP EDGE */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(34, 35, 63, 0.1);
    position: relative;
}

.nexus-viewer-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.95);
    z-index: 10;
}

.nexus-viewer-title h2 {
    margin: 0;
    color: var(--nexus-navy);
    font-size: 22px;
    line-height: 1.2;
}

.nexus-badge {
    display: inline-block;
    background: rgba(211, 174, 53, 0.1);
    color: var(--nexus-gold);
    padding: 4px 8px;
    border-radius: 0 !important; /* SHARP EDGE */
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.05em; /* Added spacing to badges */
}

/* Controls */
.nexus-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nexus-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 0 !important; /* SHARP EDGE */
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    text-decoration: none;
    transition: 0.2s;
    white-space: nowrap;
    letter-spacing: 0.03em; /* Added spacing to buttons */
}

.nexus-zoom-group {
    display: flex;
    background: #f0f0f0;
    border-radius: 0 !important; /* SHARP EDGE */
    padding: 3px;
    align-items: center;
}

.nexus-zoom-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    border-radius: 0 !important; /* SHARP EDGE */
    cursor: pointer;
    color: var(--nexus-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nexus-zoom-val {
    padding: 0 8px;
    font-size: 11px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    letter-spacing: 0.02em; /* Added spacing */
}

/* Canvas / Image Area */
.nexus-canvas {
    flex: 1;
    overflow: hidden;
    position: relative;
    background-color: #f9fafb;
    cursor: grab;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(34, 35, 63, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 35, 63, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

.nexus-canvas:active {
    cursor: grabbing;
}

.nexus-canvas img {
    /* Image Cover Styling for Better Fit */
    max-width: 95%;
    max-height: 95%;
    object-fit: contain; 
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.1));
    transform-origin: center center;
    pointer-events: none;
    user-select: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
}

/* Class to trigger animation safely */
.nexus-canvas img.animate-reveal {
    animation: nexusImageReveal 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* --- MOBILE RESPONSIVE FIXES --- */
@media (max-width: 768px) {
    #nexus-app-container {
        height: auto; 
        padding: 10px;
        min-height: auto;
    }

    .nexus-layout {
        flex-direction: column;
        height: auto;
        gap: 15px;
    }

    .nexus-sidebar {
        width: 100%;
        height: 280px; 
        max-height: 40vh;
    }

    .nexus-viewer {
        height: 800px; 
        min-height: 80vh; 
        display: flex;
        flex-direction: column;
    }

    .nexus-canvas {
        flex: 1; 
        min-height: 0; 
    }

    .nexus-viewer-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nexus-viewer-title {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .nexus-controls {
        width: 100%;
        justify-content: space-between;
    }
}