/* Main Footer */
.main-footer {
    width: 100%;
    max-width: 800px;
    margin: 20px auto 0 auto;
    padding: 15px 20px;
    background: rgba(15, 15, 40, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 60;
    position: relative;
}

.footer-content {
    color: #fbbf24;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    font-family: "Segoe UI", Arial, sans-serif;
}

/* ===================================================================
   ULTRACIRCULUM HUB - CORE STYLING & THEMES
   Main styling system for the Hub application
   =================================================================== */

/* ===================================================================
   STARS & FIREFLIES BACKGROUND CANVAS
   =================================================================== */
.stars, .fireflies, .fireflies-front {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.stars { z-index: 0; }
.fireflies { z-index: 1; }
.fireflies-front { z-index: 2; }

/* ===================================================================
   GLOBAL RESET & BASE STYLES
   =================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    background-color: #00000F;
    font-family: "Segoe UI", Arial, sans-serif;
    overflow-x: hidden;
}

/* ===================================================================
   MAIN CONTAINER & LAYOUT
   =================================================================== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    position: relative;
    z-index: 50;
    padding: 40px 20px;
}

/* Main Header */
.main-header {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    z-index: 70;
    background: rgba(15, 15, 40, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    text-align: center;
}

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

.logo-container {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    font-family: "Segoe UI", Arial, sans-serif;
}

.logo-container img {
    height: 38px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.logo-fallback {
    color: #ffffff;
    font-size: 13px;
    font-weight: bold;
    display: none;
    font-family: "Segoe UI", Arial, sans-serif;
}

/* Auth Header Section */
.auth-header-section {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px auto;
    padding: 15px 20px;
    background: rgba(15, 15, 40, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 60;
    position: relative;
    transition: all 0.3s ease;
}

/* When authenticated, justify content to the right for desktop */
@media (min-width: 481px) {
    .auth-header-section.authenticated {
        justify-content: flex-end;
    }
    
    .auth-header-section.authenticated .auth-controls {
        margin-left: auto;
    }
}

.register-controls {
    font-family: "Segoe UI", Arial, sans-serif;
}

.nav-register-btn {
    color: #ff8c69;
    background: rgba(255, 140, 105, 0.1);
    border: 1px solid rgba(255, 140, 105, 0.5);
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(255, 140, 105, 0.2);
    font-family: "Segoe UI", Arial, sans-serif;
}

.nav-register-btn:hover {
    color: #ff8c69;
    background: rgba(255, 140, 105, 0.2);
    border-color: rgba(255, 140, 105, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 140, 105, 0.3);
}

.auth-controls {
    font-family: "Segoe UI", Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
    flex-shrink: 0;
}

/* Better mobile auth header layout */
@media (max-width: 480px) {
    .auth-header-section {
        justify-content: center;
        flex-direction: column;
        gap: 12px;
        padding: 15px;
        align-items: center;
    }
    
    .register-controls,
    .auth-controls {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .auth-btn,
    .nav-register-btn {
        width: 120px;
        min-width: 120px;
        max-width: 120px;
        text-align: center;
        justify-content: center;
    }
    
    .auth-section {
        width: 100%;
        justify-content: center;
    }
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}

.auth-btn {
    background-color: rgba(135, 170, 255, 0.1);
    border: 1px solid rgba(135, 170, 255, 0.3);
    color: #87aaff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Segoe UI", Arial, sans-serif;
    white-space: nowrap;
}

.auth-btn:hover {
    background-color: rgba(135, 170, 255, 0.2);
    border-color: rgba(135, 170, 255, 0.5);
    transform: translateY(-1px);
}

.login-btn:hover {
    background-color: rgba(135, 170, 255, 0.15);
}

.logout-btn {
    background-color: rgba(255, 130, 130, 0.1);
    border-color: rgba(255, 130, 130, 0.3);
    color: #ff8282;
}

.logout-btn:hover {
    background-color: rgba(255, 130, 130, 0.2);
    border-color: rgba(255, 130, 130, 0.5);
}

.user-welcome {
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    font-family: "Segoe UI", Arial, sans-serif;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Main Window */
.main-window {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
    z-index: 60;
    position: relative;
}

.main-app {
    background-color: rgba(15, 15, 40, 0.3);
    width: 100%;
    border-radius: 12px;
    padding: 30px;
    font-family: "Segoe UI", Arial, sans-serif;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 10;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* ===================================================================
   SECTION TITLE STYLING
   =================================================================== */
.section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: left;
    font-family: 'Segoe UI', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
}

.section-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* ===================================================================
   LOADING & ERROR STATES
   =================================================================== */
.loading-state {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    padding: 40px 20px;
    font-family: "Segoe UI", Arial, sans-serif;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-state {
    text-align: center;
    color: rgba(255, 130, 130, 0.8);
    font-size: 14px;
    padding: 40px 20px;
    font-family: "Segoe UI", Arial, sans-serif;
}

.empty-state {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    padding: 40px 20px;
    font-style: italic;
    font-family: "Segoe UI", Arial, sans-serif;
}

.empty-downloads {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    padding: 40px 20px;
    font-style: italic;
    font-family: "Segoe UI", Arial, sans-serif;
}

/* ===================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   =================================================================== */

/* Desktop Styles */
@media (min-width: 1024px) {
    .container {
        padding: 50px 20px;
    }
    
    .main-app {
        padding: 50px;
        border-radius: 16px;
    }

    .section-title {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .section-icon {
        width: 36px;
        height: 36px;
    }
}

/* Large Desktop */
@media (min-width: 1440px) {
    .container {
        padding: 60px 20px;
        max-width: 1200px;
    }
    
    .main-header,
    .auth-header-section,
    .main-window,
    .main-footer {
        max-width: 900px;
    }

    .main-app {
        padding: 60px;
        border-radius: 20px;
    }

    .section-title {
        font-size: 32px;
    }

    .section-icon {
        width: 40px;
        height: 40px;
    }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 40px 15px;
    }
    
    .main-app {
        padding: 35px;
        border-radius: 14px;
    }

    .section-title {
        font-size: 22px;
    }

    .section-icon {
        width: 28px;
        height: 28px;
    }
}

/* Mobile Styles */
@media (max-width: 767px) {
    .container {
        padding: 20px 10px;
    }
    
    .main-header {
        padding: 15px;
        max-width: calc(100vw - 40px);
        margin: 0 auto 15px auto;
    }
    
    .logo-container {
        height: 28px;
        min-width: 120px;
    }
    
    .logo-container img {
        height: 28px;
    }
    
    .logo-fallback {
        font-size: 10px;
    }
    
    .auth-header-section {
        max-width: calc(100vw - 40px);
        margin: 0 auto 15px auto;
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .register-controls {
        flex-shrink: 0;
    }
    
    .auth-controls {
        flex-shrink: 0;
        min-width: 0;
    }
    
    .auth-btn,
    .nav-register-btn {
        padding: 8px 12px;
        font-size: 10px;
        min-width: 60px;
        white-space: nowrap;
    }
    
    .user-welcome {
        font-size: 10px;
        max-width: 100px;
        min-width: 0;
        flex-shrink: 1;
    }
    
    .auth-section {
        flex-wrap: nowrap;
        gap: 6px;
        min-width: 0;
    }
    
    .main-window {
        max-width: calc(100vw - 40px);
    }

    .main-app {
        padding: 25px;
        border-radius: 12px;
    }
    
    .main-footer {
        max-width: calc(100vw - 40px);
        padding: 12px 15px;
    }
    
    .footer-content {
        font-size: 0.75rem;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .section-icon {
        width: 24px;
        height: 24px;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 15px 10px;
    }
    
    .main-header,
    .auth-header-section {
        margin-bottom: 10px;
        padding: 10px 15px;
    }
    
    .main-header {
        padding: 12px;
    }
    
    .auth-header-section {
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .logo-container {
        height: 24px;
        min-width: 100px;
    }
    
    .logo-container img {
        height: 24px;
    }
    
    .logo-fallback {
        font-size: 9px;
    }
    
    .auth-btn,
    .nav-register-btn {
        padding: 6px 10px;
        font-size: 9px;
        min-width: 50px;
        white-space: nowrap;
    }
    
    .user-welcome {
        font-size: 9px;
        max-width: 90px;
    }
    
    .auth-section {
        gap: 5px;
    }

    .main-app {
        padding: 20px;
        border-radius: 10px;
    }
    
    .main-footer {
        margin-top: 10px;
        padding: 10px 15px;
    }
    
    .footer-content {
        font-size: 0.7rem;
    }

    .section-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .section-icon {
        width: 22px;
        height: 22px;
    }
}

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */
.hidden {
    display: none !important;
}

/* ===================================================================
   UNIVERSAL FONT OVERRIDES
   =================================================================== */
*,
*::before,
*::after {
    font-family: "Segoe UI", Arial, sans-serif;
}

input,
textarea,
select,
button {
    font-family: "Segoe UI", Arial, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Segoe UI", Arial, sans-serif;
}

p,
span,
div,
a,
label {
    font-family: "Segoe UI", Arial, sans-serif;
}

/* ===================================================================
   SMOOTH TRANSITIONS
   =================================================================== */
.main-app,
.section-title,
.loading-spinner {
    transition: all 0.3s ease;
}

/* ===================================================================
   APP ICONS SECTION - FULL WIDTH OPTIMIZATION
   =================================================================== */
.app-icons-section {
    margin-left: -15px;
    margin-right: -15px;
    padding-left: 15px;
    padding-right: 15px;
}

.app-icons-container {
    width: 100%;
    max-width: none;
}

/* Desktop optimizations */
@media (min-width: 1024px) {
    .app-icons-section {
        margin-left: -25px;
        margin-right: -25px;
        padding-left: 25px;
        padding-right: 25px;
    }
}

/* Large Desktop optimizations */
@media (min-width: 1440px) {
    .app-icons-section {
        margin-left: -30px;
        margin-right: -30px;
        padding-left: 30px;
        padding-right: 30px;
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1023px) {
    .app-icons-section {
        margin-left: -17px;
        margin-right: -17px;
        padding-left: 17px;
        padding-right: 17px;
    }
}

/* Mobile optimizations */
@media (max-width: 767px) {
    .app-icons-section {
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* ===================================================================
   MOBILE SVG FIXES - Prevent rogue play buttons
   =================================================================== */
@media (max-width: 767px) {
    /* Hide any unwanted positioned SVG elements that might appear */
    svg[style*="position: absolute"],
    svg[style*="position: fixed"],
    div[style*="position: absolute"] svg,
    div[style*="position: fixed"] svg {
        display: none !important;
    }
    
    /* Hide potential play button elements */
    *[class*="play"],
    *[id*="play"],
    *[class*="player"],
    *[id*="player"] {
        display: none !important;
    }
    
    /* Additional safeguard for floating elements on mobile */
    *[style*="position: absolute"][style*="right:"][style*="top:"] {
        display: none !important;
    }
}