/* Study Room V4 - Main Stylesheet */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    overflow: hidden;
    user-select: none;
}

body {
    display: flex;
    flex-direction: column;
}

/* Navigation Header */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.site-title {
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 2px;
    color: #ffffff;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-button {
    color: #ffffff;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.preview-link {
    background: rgba(68, 170, 136, 0.2);
    border-color: rgba(68, 170, 136, 0.5);
    color: #44aa88;
}

.preview-link:hover {
    background: rgba(68, 170, 136, 0.3);
    border-color: #44aa88;
}

/* Main Canvas Container */
.canvas-container {
    flex: 1;
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #1a1a1a;
    overflow: hidden;
}

/* Controls Info Panel */
/* Contextual HUD System */
.hud-system {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1100;
}

.hud-panel {
    position: absolute;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 6px;
    backdrop-filter: blur(3px);
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hud-panel.visible {
    opacity: 1;
    transform: scale(1);
}

.hud-top-left {
    top: 80px;
    left: 20px;
    border-color: rgba(33, 150, 243, 0.4);
}

.hud-top-right {
    top: 80px;
    right: 20px;
    border-color: rgba(156, 39, 176, 0.4);
}

.hud-bottom-left {
    bottom: 80px;
    left: 20px;
    border-color: rgba(255, 152, 0, 0.4);
}

.hud-bottom-right {
    bottom: 80px;
    right: 20px;
    border-color: rgba(76, 175, 80, 0.4);
}

.hud-content {
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
    white-space: nowrap;
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 120px;
}

.hud-shortcut {
    background: rgba(76, 175, 80, 0.2);
    color: #81C784;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 12px;
}

.hud-separator {
    color: rgba(255, 255, 255, 0.4);
    margin: 0 6px;
}

.hud-action {
    color: #FFB74D;
    font-weight: 500;
}

.hud-context {
    color: #BA68C8;
    font-weight: 500;
}

.hud-breadcrumb {
    color: #64B5F6;
    font-size: 11px;
}

.hud-breadcrumb-arrow {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 4px;
}

/* Help Toggle Button */
.help-toggle-button {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1050;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
}

.help-toggle-button:hover {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
    transform: scale(1.1);
}

.help-toggle-button span {
    color: #81C784;
    font-weight: bold;
    font-size: 16px;
    font-family: 'Segoe UI', sans-serif;
}




.controls-content {
    padding: 20px;
    position: relative;
}

.controls-content h3 {
    margin-bottom: 15px;
    color: #44aa88;
    font-size: 18px;
    font-weight: 400;
}

.controls-content ul {
    list-style: none;
}

.controls-content li {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.4;
    color: #cccccc;
}

.controls-content strong {
    color: #ffffff;
    font-weight: 600;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 12px;
    color: #cccccc;
}

.footer-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.footer-links a {
    color: #44aa88;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-links span {
    color: #666666;
}

/* Warning and Error Messages */
.performance-warning,
.error-display {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.warning-content,
.error-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.warning-content h3,
.error-content h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.warning-content p,
.error-content p {
    margin-bottom: 20px;
    color: #cccccc;
    line-height: 1.5;
}

.warning-content button,
.error-content button {
    background: #44aa88;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.warning-content button:hover,
.error-content button:hover {
    background: #369970;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    color: #44aa88;
    font-size: 24px;
    font-weight: 400;
}

.modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 30px;
}

.modal-body h3 {
    color: #ffffff;
    margin: 20px 0 10px 0;
    font-size: 18px;
    font-weight: 400;
}

.modal-body p {
    color: #cccccc;
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal-body ul {
    color: #cccccc;
    margin-left: 20px;
    margin-bottom: 15px;
}

.modal-body li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Loading Screen Overrides */
#load-screen {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .site-title {
        font-size: 16px;
    }
    
    .nav-links {
        gap: 10px;
    }
    
    .nav-button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Mobile HUD System */
    .hud-top-left,
    .hud-top-right {
        top: 10px;
    }
    
    .hud-bottom-left,
    .hud-bottom-right {
        bottom: 10px;
    }
    
    .hud-top-left,
    .hud-bottom-left {
        left: 10px;
    }
    
    .hud-top-right,
    .hud-bottom-right {
        right: 10px;
    }
    
    .hud-content {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 200px;
    }
    
    .hud-shortcut {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .help-toggle-button {
        top: 70px;
        right: 10px;
        width: 28px;
        height: 28px;
    }
    
    .help-toggle-button span {
        font-size: 14px;
    }
    
    .help-container.compact {
        width: 95vw;
        margin: 10px;
    }
    
    .help-quick-ref {
        font-size: 12px;
    }
    
    .modal-content {
        margin: 20px;
        max-width: none;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .footer-content {
        padding: 0 15px;
        font-size: 10px;
    }
    
    .footer-links {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .nav-links .nav-button:not(.preview-link) {
        display: none;
    }
    
    .site-title {
        font-size: 14px;
    }
    
    .footer-content {
        flex-direction: column;
        height: 60px;
        justify-content: center;
        gap: 5px;
    }
}

/* High DPI Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .nav-header,
    .footer {
        border-width: 0.5px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .nav-header,
    .footer,
    .controls-info,
    .modal,
    .performance-warning,
    .error-display {
        display: none !important;
    }
    
    .canvas-container {
        height: 100vh;
        background: #ffffff;
    }
}

/* Focus Indicators for Accessibility */
.nav-button:focus,
.close-btn:focus,
.modal-close:focus,
button:focus {
    outline: 2px solid #44aa88;
    outline-offset: 2px;
}

/* Selection Styles */
::selection {
    background: rgba(68, 170, 136, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background: rgba(68, 170, 136, 0.3);
    color: #ffffff;
}