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

:root {
    --primary-color: #00B4D8;
    --primary-hover: #0096B4;
    --dark-bg: rgba(0, 0, 0, 0.7);
    --dark-bg-solid: #1a1a1a;
    --text-light: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: var(--text-light);
}

/* Logo Loader */
.logo-loader {
    margin-bottom: 30px;
}

.logo-container {
    position: relative;
    width: 300px;
    height: auto;
    margin: 0 auto;
}

/* White outline logo (base layer) */
.logo-outline {
    width: 100%;
    height: auto;
    filter: brightness(0) invert(1);
    opacity: 0.3;
}

/* Purple filled logo (animated layer) */
.logo-fill-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.3s ease;
}

.logo-fill {
    width: 100%;
    height: auto;
    filter: brightness(0) saturate(100%) invert(29%) sepia(97%) saturate(3066%) hue-rotate(241deg) brightness(99%) contrast(98%);
}

#progress-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    letter-spacing: 2px;
}

/* Responsive logo loader */
@media (max-width: 768px) {
    .logo-container {
        width: 250px;
    }
}

@media (max-width: 480px) {
    .logo-container {
        width: 200px;
    }

    #progress-text {
        font-size: 14px;
    }
}

/* Unity Canvas */
#unity-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
    touch-action: none;
    background: #231F20;
}

/* UI Overlay */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#ui-overlay > * {
    pointer-events: auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 24px;
    width: auto;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--dark-bg);
    border: none;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hamburger span {
    width: 18px;
    height: 2px;
    background: var(--text-light);
    border-radius: 1px;
    transition: var(--transition);
}

.menu-btn.active .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.menu-btn.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.menu-btn.active .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile Menu */
.mobile-menu {
    position: absolute;
    top: 70px;
    right: 24px;
    background: var(--dark-bg-solid);
    border-radius: var(--border-radius);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    backdrop-filter: blur(10px);
    min-width: 180px;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-menu ul {
    list-style: none;
}

.mobile-menu li a {
    display: block;
    padding: 12px 24px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.mobile-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

/* Bottom Panel */
.bottom-panel {
    position: absolute;
    bottom: 40px;
    left: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--dark-bg);
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.control-btn svg {
    width: 20px;
    height: 20px;
}

.project-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.project-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    max-width: 400px;
}

.register-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: var(--transition);
}

.register-btn:hover {
    background: var(--primary-hover);
    transform: translateX(4px);
}

.register-btn svg {
    width: 16px;
    height: 16px;
}

/* Powered By Footer */
.powered-by {
    position: absolute;
    bottom: 40px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.powered-by-logo {
    height: 18px;
    width: auto;
}

/* Settings Panel */
.settings-panel {
    position: absolute;
    bottom: 120px;
    left: 24px;
    background: var(--dark-bg-solid);
    border-radius: var(--border-radius);
    padding: 20px;
    min-width: 220px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.settings-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-panel h3 {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.settings-panel > .setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    color: var(--text-muted);
    font-size: 13px;
}

.settings-section-title {
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 16px 0 12px 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-item input[type="range"] {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Select */
.settings-panel select {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-light);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

/* Ultra Modern Glassmorphism Modal */
.glass-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    isolation: isolate;
}

.glass-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.glass-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 180, 216, 0.1), rgba(0, 0, 0, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1;
    pointer-events: none;
}

.glass-modal-content {
    position: relative;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.05)
    );
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 48px 40px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(0, 180, 216, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    pointer-events: auto;
}

.glass-modal.active .glass-modal-content {
    transform: scale(1) translateY(0);
}

/* Close Button */
.glass-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: auto;
}

.glass-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.glass-close svg {
    width: 20px;
    height: 20px;
}

/* Header with Glow Effect */
.glass-header {
    position: relative;
    text-align: center;
    margin-bottom: 40px;
}

.glass-title-glow {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 60px;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.4), transparent 70%);
    filter: blur(30px);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

.glass-title {
    position: relative;
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #00B4D8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.glass-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 400;
}

/* Button Container */
.glass-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: auto;
}

/* Action Buttons */
.glass-action-btn {
    position: relative;
    width: 100%;
    padding: 18px 32px;
    border: none;
    border-radius: 16px;
    color: white;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    pointer-events: auto;
}

/* Primary Button - Visit Diriyah */
.glass-btn-primary {
    background: linear-gradient(135deg, #00B4D8 0%, #0096B4 100%);
    box-shadow:
        0 4px 20px rgba(0, 180, 216, 0.4),
        0 0 40px rgba(0, 180, 216, 0.2);
    z-index: 1;
}

.glass-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 30px rgba(0, 180, 216, 0.6),
        0 0 60px rgba(0, 180, 216, 0.4);
}

.glass-btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button - Contact Augmento */
.glass-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.glass-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.glass-btn-secondary:active {
    transform: translateY(0);
}

/* Legacy Submit Button - Keep for Compatibility */
.glass-submit-btn {
    position: relative;
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, #00B4D8 0%, #0096B4 100%);
    border: none;
    border-radius: 16px;
    color: white;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 4px 20px rgba(0, 180, 216, 0.4),
        0 0 40px rgba(0, 180, 216, 0.2);
    pointer-events: auto;
}

.glass-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 30px rgba(0, 180, 216, 0.6),
        0 0 60px rgba(0, 180, 216, 0.4);
}

.glass-submit-btn:active {
    transform: translateY(0);
}

.glass-btn-text {
    position: relative;
    z-index: 2;
}

.glass-btn-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.glass-btn-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.glass-action-btn:hover .glass-btn-arrow {
    transform: translateX(4px);
}

.glass-submit-btn:hover .glass-btn-arrow {
    transform: translateX(4px);
}

.glass-btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.5s ease;
    pointer-events: none;
}

.glass-submit-btn:hover .glass-btn-glow {
    transform: translate(-50%, -50%) scale(2);
}

/* Responsive */
@media (max-width: 600px) {
    .glass-modal-content {
        padding: 32px 24px;
        max-width: 95%;
    }

    .glass-title {
        font-size: 26px;
    }

    .glass-subtitle {
        font-size: 13px;
    }

    .glass-input {
        padding: 14px 14px 14px 48px;
        font-size: 14px;
    }

    .glass-submit-btn {
        padding: 16px 24px;
        font-size: 15px;
    }
}

/* Responsive Styles */

/* Tablet */
@media (max-width: 768px) {
    .header {
        padding: 16px 20px;
    }

    .bottom-panel {
        left: 20px;
        bottom: 50px;
    }

    .project-title {
        font-size: 20px;
        max-width: 280px;
    }

    .powered-by {
        bottom: 50px;
        right: 20px;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }

    .logo-img {
        height: 20px;
    }

    .menu-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    .menu-btn span {
        display: none;
    }

    .bottom-panel {
        left: 16px;
        bottom: 40px;
    }

    .project-title {
        font-size: 18px;
        line-height: 1.3;
        max-width: 240px;
    }

    .register-btn {
        padding: 10px 16px;
        font-size: 11px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }

    .control-btn svg {
        width: 18px;
        height: 18px;
    }

    .powered-by {
        bottom: 40px;
        right: 16px;
        font-size: 11px;
    }

    .powered-by-logo {
        height: 16px;
    }

    .settings-panel {
        left: 16px;
        right: 16px;
        bottom: 100px;
    }
}

/* Mobile Landscape */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 10px 20px;
    }

    .bottom-panel {
        bottom: 10px;
        left: 20px;
        flex-direction: row;
        align-items: center;
        gap: 20px;
    }

    .project-info {
        flex-direction: row;
        align-items: center;
        gap: 20px;
    }

    .project-title {
        font-size: 16px;
        max-width: none;
    }

    .register-btn {
        padding: 8px 14px;
        font-size: 10px;
    }

    .powered-by {
        bottom: 10px;
        right: 20px;
    }

    .settings-panel {
        bottom: 60px;
    }
}

/* Hover Effects - Desktop Only */
@media (hover: hover) {
    .control-btn:hover {
        transform: scale(1.05);
    }
}

/* Info Popup - Frosted Glass Style */
.info-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    pointer-events: none;
}

.info-popup.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.info-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.info-popup-content {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: var(--transition);
}

.info-popup.active .info-popup-content {
    transform: scale(1) translateY(0);
}

.info-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.info-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.info-popup-content h2 {
    color: white;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-popup-content p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.info-popup-content ul {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.8;
    margin: 16px 0;
    padding-left: 24px;
}

.info-popup-content li {
    margin-bottom: 8px;
}

.info-popup-content li::marker {
    color: #ffd700;
}

.info-popup-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    border: none;
    border-radius: 30px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.info-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* Settings Panel Info Styles */
.settings-info {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.settings-controls {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-controls li {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.8;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-controls li:last-child {
    border-bottom: none;
}

.settings-controls strong {
    color: var(--text-light);
    font-weight: 600;
}
