/* Game of Life - p5.js Shaders Styles */

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

html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: #000;
    overflow: hidden;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #e5e5e5;
    font-weight: 300;
    line-height: 1.35;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

/* Header and Navigation - Remove all spacing */
header {
    margin: 0 !important;
    padding: 0 !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

/* Navigation Bar - Advanced Frosted Glass Design */
#navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1200px;
    height: 64px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.6, 1);
    position: relative;
}

#navbar::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.1) 0%, 
                transparent 50%, 
                rgba(255, 255, 255, 0.05) 100%);
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#navbar:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07));
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 
        0 10px 24px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#navbar:hover::before {
    opacity: 1;
}

#navbar h1 {
    color: #f5f5f5;
    font-size: 20px;
    font-weight: 400;
    margin: 0;
    letter-spacing: -0.5px;
    text-transform: none;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
}

/* Controls in navbar */
.navbar-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.control-button {
    position: relative;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.6, 1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    height: 40px;
    display: flex;
    align-items: center;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.control-button::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.1) 0%, 
                transparent 50%, 
                rgba(255, 255, 255, 0.05) 100%);
    border-radius: 10px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.control-button:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07));
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 
        0 10px 24px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.control-button:hover::before {
    opacity: 1;
}

.control-button:active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.05));
}

.control-key {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    color: rgba(255, 255, 255, 0.6);
}

.control-info {
    position: relative;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    height: 40px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.control-info::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.1) 0%, 
                transparent 50%, 
                rgba(255, 255, 255, 0.05) 100%);
    border-radius: 10px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mouse-icon {
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
    transform: translateY(1px);
}

/* Canvas Container - Full Screen Behind Navbar */
#canvas-container {
    position: fixed;
    top: 0 !important;
    left: 0 !important;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    z-index: 1;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

/* p5.js canvas styling - Force full screen */
#canvas-container canvas {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    #navbar {
        width: calc(100% - 24px);
        top: 12px;
        height: 56px;
        padding: 0 20px;
    }
    
    #navbar h1 {
        font-size: 18px;
        letter-spacing: -0.3px;
    }
    
    .navbar-controls {
        gap: 8px;
    }
    
    .control-button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .control-key {
        display: none;
    }
}

@media (max-width: 480px) {
    #navbar {
        flex-direction: column;
        height: 80px;
        padding: 12px 16px;
        gap: 8px;
    }
    
    #navbar h1 {
        font-size: 16px;
    }
    
    .navbar-controls {
        width: 100%;
        justify-content: center;
        gap: 6px;
    }
    
    .control-button {
        flex: 1;
        padding: 4px 8px;
        font-size: 11px;
        min-width: 0;
        text-align: center;
    }
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: rgba(100, 150, 255, 0.8);
    font-size: 18px;
    text-shadow: 0 0 10px rgba(100, 150, 255, 0.5);
}

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