/* ========================================
   FRACTALLA - Interface Components
   Header, Canvas, Controls, GUI
   ======================================== */

/* ========================================
   FLOATING HEADER - Minimal & Elegant
   ======================================== */
.floating-header {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
    animation: fadeInDown 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.brand h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: var(--divine-white);
    margin-bottom: 0.5rem;
    text-shadow:
        0 0 30px rgba(25, 242, 255, 0.6),
        0 0 60px rgba(25, 242, 255, 0.4),
        0 0 90px rgba(167, 139, 250, 0.3);
    position: relative;
    text-transform: uppercase;
}

.brand h1::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 188px;
    height: 2px;
    background: var(--gradient-aurora);
    box-shadow:
        0 0 20px rgba(25, 242, 255, 0.8),
        0 0 40px rgba(167, 139, 250, 0.6);
}

.tagline {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1.2rem;
}

/* ========================================
   MOBILE SHARE BUTTON - Top Right
   ======================================== */
.mobile-share-btn {
    display: none;
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 207, 255, 0.61);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    z-index: 1500;
}

.mobile-share-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: var(--gradient-aurora);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.mobile-share-btn:hover::before {
    opacity: 1;
    animation: orbRotate 3s linear infinite;
}

.mobile-share-btn svg {
    width: 22px;
    height: 22px;
    color: var(--divine-white);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
    transition: all 0.3s ease;
}

.mobile-share-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--glow-cyan);
}

.mobile-share-btn:hover svg {
    transform: rotate(90deg);
    color: var(--spirit-purple);
    filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.8));
}

.mobile-share-btn:active {
    transform: scale(0.95);
}

/* ========================================
   PLAYBACK CONTROLS - Sacred Geometry
   ======================================== */
.playback-controls {
    position: fixed;
    top: 9rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    box-shadow: var(--glass-shadow);
    animation: fadeInDown 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.playback-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(25, 242, 255, 0.15), rgba(167, 139, 250, 0.15));
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.playback-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: var(--gradient-aurora);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.playback-btn:hover::before {
    opacity: 1;
}

.playback-btn svg {
    width: 20px;
    height: 20px;
    color: var(--aurora-cyan);
    filter: drop-shadow(0 0 8px rgba(25, 242, 255, 0.6));
    transition: all 0.3s ease;
}

.playback-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--glow-cyan);
}

.playback-btn:hover svg {
    color: var(--spirit-purple);
    filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.8));
}

.playback-btn:active {
    transform: scale(0.95);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.speed-control label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.speed-control input[type="range"] {
    width: 120px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right,
        var(--aurora-cyan) 0%,
        var(--aurora-cyan) 45%,
        rgba(0, 0, 0, 0.4) 45%,
        rgba(0, 0, 0, 0.4) 100%);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 0 10px rgba(25, 242, 255, 0.2);
}

.speed-control input[type="range"]::-webkit-slider-track {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

.speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gradient-aurora);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(25, 242, 255, 0.5);
    transition: all 0.3s ease;
}

.speed-control input[type="range"]::-moz-range-track {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

.speed-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gradient-aurora);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(25, 242, 255, 0.5);
    transition: all 0.3s ease;
}

.speed-control input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.2);
    box-shadow: var(--glow-cyan);
}

.speed-control input[type="range"]:hover::-moz-range-thumb {
    transform: scale(1.2);
    box-shadow: var(--glow-cyan);
}

.speed-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--aurora-cyan);
    min-width: 32px;
    text-align: right;
    text-shadow: 0 0 8px rgba(25, 242, 255, 0.4);
}

/* ========================================
   CANVAS CONTAINER - Immersive Fullscreen
   ======================================== */
#canvas-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(75vh, 75vw);
    height: min(75vh, 75vw);
    border-radius: 50%;
    overflow: hidden;
    background: var(--void-black);
    box-shadow:
        0 0 2px 1px rgba(255, 255, 255, 0.05),
        0 0 60px rgba(25, 242, 255, 0.2),
        0 0 120px rgba(167, 139, 250, 0.15),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
    animation: fadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both,
               mandalaGlow 6s ease-in-out infinite;
    z-index: 1;
}

#canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ========================================
   CONTROL ORBS - Floating Sacred Geometry
   ======================================== */
.control-orbs {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1.5rem;
    z-index: 200;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

.orb-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.orb-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    text-shadow: 0 0 8px rgba(25, 242, 255, 0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.orb-container:hover .orb-label {
    color: var(--aurora-cyan);
    text-shadow: 0 0 12px rgba(25, 242, 255, 0.6);
}

.orb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.orb-share {
    background: rgba(0, 207, 255, 0.61);
}

.orb::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: var(--gradient-aurora);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.orb:hover::before {
    opacity: 1;
    animation: orbRotate 3s linear infinite;
}

.orb svg {
    width: 24px;
    height: 24px;
    color: var(--aurora-cyan);
    filter: drop-shadow(0 0 8px rgba(25, 242, 255, 0.6));
    transition: all 0.3s ease;
}

.orb:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--glow-cyan);
}

.orb:hover svg {
    transform: rotate(90deg);
    color: var(--spirit-purple);
    filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.8));
}

.orb:active {
    transform: translateY(-2px) scale(0.95);
}

.orb-primary {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(25, 242, 255, 0.1), rgba(167, 139, 250, 0.1));
}

.orb-primary svg {
    width: 28px;
    height: 28px;
    animation: orbPulse 3s ease-in-out infinite;
}

/* Hide community orb (temporarily) */
#orb-community {
    display: none;
}

.orb-container:has(#orb-community) {
    display: none;
}

/* ========================================
   MOBILE CONTROLS TOGGLE
   ======================================== */
.mobile-controls-toggle {
    display: none;
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    width: 90%;
    max-width: 500px;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-controls-toggle.expanded {
    /* Position will be set by JavaScript to sit above GUI */
}

.mobile-controls-toggle.collapsed {
    bottom: 10px !important;
}

.toggle-controls-btn {
    width: 100%;
    padding: 12px 20px;
    background: rgba(10, 10, 18, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 12px 12px 0 0;
    color: var(--divine-white);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.mobile-controls-toggle.collapsed .toggle-controls-btn {
    border-radius: 12px;
}

.toggle-controls-btn:hover {
    background: rgba(167, 139, 250, 0.15);
    border-color: var(--aurora-cyan);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.mobile-controls-toggle.collapsed .toggle-icon {
    transform: rotate(180deg);
}

/* ========================================
   dat.GUI MYSTICAL STYLING
   ======================================== */
.dg.ac {
    z-index: 1000 !important;
}

.dg.main {
    background: rgba(10, 10, 18, 0.85) !important;
    backdrop-filter: blur(40px) saturate(180%) !important;
    border: 1px solid rgba(167, 139, 250, 0.2) !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        var(--glow-purple) !important;
    border-radius: 16px !important;
}

.dg .title {
    background: var(--gradient-cosmic) !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.15em !important;
    color: var(--divine-white) !important;
    font-size: 0.75rem !important;
    text-shadow: 0 0 10px rgba(25, 242, 255, 0.5) !important;
    border-bottom: 2px solid rgba(25, 242, 255, 0.3) !important;
}

.dg .close-button {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 4px !important;
}

.dg .close-button:hover {
    background: rgba(25, 242, 255, 0.2) !important;
}

.dg li:not(.folder) {
    background: rgba(255, 255, 255, 0.02) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    transition: all 0.2s ease !important;
}

.dg li:not(.folder):hover {
    background: rgba(167, 139, 250, 0.08) !important;
}

.dg li.folder {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    margin-top: 4px !important;
}

.dg li.folder > .title {
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.15em !important;
    color: var(--aurora-cyan) !important;
    text-transform: uppercase !important;
    padding: 10px 8px !important;
    background: rgba(25, 242, 255, 0.08) !important;
    border-left: 3px solid var(--aurora-cyan) !important;
    text-shadow: 0 0 10px rgba(25, 242, 255, 0.4) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.dg li.folder > .title:hover {
    background: rgba(25, 242, 255, 0.15) !important;
    border-left-color: var(--spirit-purple) !important;
    color: var(--spirit-purple) !important;
}

.dg .cr.string input[type="text"],
.dg .cr.number input[type="text"],
.dg .cr.boolean,
.dg .cr.function {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(167, 139, 250, 0.2) !important;
    color: var(--divine-white) !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
}

.dg .cr.string input[type="text"]:hover,
.dg .cr.number input[type="text"]:hover {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: var(--aurora-cyan) !important;
    box-shadow: 0 0 10px rgba(25, 242, 255, 0.2) !important;
}

.dg .cr.function:hover {
    background: rgba(25, 242, 255, 0.1) !important;
    border-color: var(--aurora-cyan) !important;
    transform: translateX(2px);
}

.dg .slider {
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: 6px !important;
}

.dg .slider-fg {
    background: var(--gradient-aurora) !important;
    border-radius: 6px !important;
    box-shadow: 0 0 10px rgba(25, 242, 255, 0.3) !important;
}

/* ========================================
   FULLSCREEN MODE
   ======================================== */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
    border-radius: 0 !important;
    z-index: 9999;
}

.fullscreen canvas {
    border-radius: 0 !important;
}
