/* =========================
   Phantom WireGuard CSS Styles
   ========================= */

/* =========================
   Page Loader Styles
   ========================= */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0F172A;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(74, 222, 128, 0.2);
    border-top-color: #4ADE80;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loader-text {
    color: #4ADE80;
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0;
    animation: fadeInOut 2s ease-in-out infinite;
}

.loader-progress {
    width: 200px;
    height: 2px;
    background: rgba(74, 222, 128, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 20px;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4ADE80, #86EFAC, #4ADE80);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    width: 0;
    transition: width 0.3s ease;
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* =========================
   CSS Variables & Root Styles
   ========================= */
:root {
    /* Colors */
    --bg-primary: #0F172A;
    --text-primary: #9CA3AF;
    --text-secondary: #6B7280;
    --text-tertiary: #4B5563;

    --green-primary: #4ADE80;
    --green-secondary: #86EFAC;
    --green-dark: #166534;
    --green-darker: #14532D;

    --border-light: rgba(74, 222, 128, 0.1);
    --bg-overlay: rgba(16, 185, 129, 0.03);
    --bg-input: rgba(16, 185, 129, 0.05);

    --error-color: #DC2626;

    /* Spacing */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Typography */
    --font-mono: 'Orbitron', monospace;
    --font-system: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s ease;
    --transition-slow: 1s ease-out;

    /* Shadows */
    --shadow-glow: 0 0 20px rgba(74, 222, 128, 0.2);
    --shadow-button: 0 4px 20px rgba(74, 222, 128, 0.2);

    /* Global responsive content width */
    --content-width: clamp(
        calc(100vw - 40px),  /* minimum: full width minus padding */
        90vw,                 /* preferred */
        500px                 /* maximum: standard width */
    );
}

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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-system), sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* =========================
   Icon Styles (SVG Sprite)
   ========================= */
.phantom-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: middle;
    transition: all var(--transition-fast);
}

/* =========================
   Background Animation
   ========================= */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* =========================
   Layout Components
   ========================= */
.container {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px 0;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-x: hidden;
}

.phantom-grid {
    display: grid;
    grid-template-areas:
        "logo"
        "install"
        "modules"
        "features"
        "navigation";
    grid-template-rows: auto auto auto auto auto;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(15px, 2.5vw, 25px);
    width: 100%;
    max-width: min(800px, calc(100vw - 40px));
    margin: 0 auto;
    align-items: center;
    justify-items: center;
    min-height: calc(100vh - 200px);
    padding: 0 20px;
    box-sizing: border-box;
    overflow-x: hidden;
    contain: layout style;
}

.grid-section {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
}

/* Grid Areas */
.logo-section {
    grid-area: logo;
    padding: 20px 0 0 0;
    overflow: hidden;
}

.features-section {
    grid-area: features;
    padding: 10px 0;
    overflow: hidden;
    animation: slideUp var(--transition-slow) 0.2s both;
}

.install-section {
    grid-area: install;
    padding: 20px 0;
    overflow: hidden;
    animation: slideUp var(--transition-slow) 0.1s both;
    max-width: var(--content-width);
    margin: 0 auto;
}

.nav-section {
    grid-area: navigation;
    padding: 0 0 20px 0;
    overflow: hidden;
}

/* =========================
   Logo Component
   ========================= */
.logo-container {
    width: 100%;
    max-width: min(600px, 90vw);
    animation: floatIn var(--transition-slow);
}

.phantom-logo {
    width: 100%;
    height: auto;
    display: block;
}

/* SVG Styles - Moved to SVG file itself */

/* =========================
   Feature Slider
   ========================= */
.feature-slider {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    position: relative;
    background: var(--bg-overlay);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-sizing: border-box;
    padding-bottom: 25px;
}

.slider-container {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.feature-slide {
    min-width: 100%;
    padding: 25px 50px 30px 50px;
    display: flex;
    align-items: center;
    gap: 25px;
    box-sizing: border-box;
    min-height: 110px;
}

.feature-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--green-dark), var(--green-darker));
    border-radius: 10px;
    box-shadow: var(--shadow-button);
}

.feature-icon .phantom-icon {
    width: 22px;
    height: 22px;
    color: var(--green-primary);
}

.feature-content {
    flex: 1;
    text-align: left;
}

.feature-title {
    font-family: var(--font-mono), monospace;
    font-size: 20px;
    font-weight: 600;
    color: var(--green-secondary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.feature-description {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

/* Slider Controls */
.slider-controls {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.3);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.slider-dot.active {
    background: var(--green-primary);
    width: 24px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.slider-dot:hover:not(.active) {
    background: rgba(74, 222, 128, 0.5);
    transform: scale(1.2);
}

/* =========================
   Install Section
   ========================= */
.install-label {
    font-family: var(--font-mono), monospace;
    font-size: 12px;
    color: var(--green-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
    text-align: center;
}

.install-container {
    background: var(--bg-input);
    border: 1px solid var(--green-dark);
    border-radius: 8px;
    padding: 16px 20px;
    position: relative;
    transition: all var(--transition-fast);
    overflow: hidden;
    width: 100%;
}

.install-container:hover {
    border-color: var(--green-primary);
    box-shadow: var(--shadow-glow);
}

.install-command {
    font-family: var(--font-mono), monospace;
    font-size: 14px;
    color: var(--green-secondary);
    margin: 0;
    padding-right: 50px;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

.install-command::-webkit-scrollbar {
    display: none;
}

#copyBtn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--green-dark);
    border: none;
    color: var(--green-primary);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    overflow: visible;
    flex-shrink: 0;
}

#copyBtn:hover {
    background: var(--green-primary);
}

#copyBtn:hover .phantom-icon {
    color: var(--bg-primary);
}

#copyBtn .phantom-icon {
    width: 16px;
    height: 16px;
    transition: all var(--transition-fast);
}

/* Button States */
#copyBtn.copied {
    background: var(--green-primary);
}

#copyBtn.copied .phantom-icon {
    color: var(--bg-primary);
}

#copyBtn.error {
    background: var(--error-color);
}

#copyBtn.error .phantom-icon {
    color: #FFFFFF;
}

/* =========================
   Navigation
   ========================= */
.links-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: slideUp var(--transition-slow) 0.25s both;
    width: 100%;
    padding: 20px 10px 40px;
    box-sizing: border-box;
}

.nav-link {
    font-family: var(--font-mono), monospace;
    font-size: 16px;
    color: var(--green-primary);
    text-decoration: none;
    position: relative;
    padding: 12px 24px;
    transition: all var(--transition-fast);
    letter-spacing: 1px;
    border-radius: 4px;
    background: transparent;
    border: 2px solid transparent;
    white-space: nowrap;
    box-sizing: border-box;
}

.nav-link:hover {
    color: var(--green-secondary);
    text-shadow: 0 0 15px rgba(74, 222, 128, 0.6);
    transform: translateY(-2px);
    background: rgba(74, 222, 128, 0.1);
    border-color: var(--green-primary);
}

/* =========================
   Footer
   ========================= */
.footer {
    position: relative;
    z-index: 1;
    width: 100%;
    margin-top: auto;
    padding: 30px 20px 40px;
    text-align: center;
    border-top: 1px solid var(--border-light);
    animation: slideUp var(--transition-slow) 0.35s both;
    box-sizing: border-box;
}

.copyright {
    font-family: var(--font-mono), monospace;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
}

.copyright-main {
    color: var(--text-primary);
    margin-bottom: 4px;
}

.copyright-trademark {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    display: inline-block;
}

/* =========================
   Animations
   ========================= */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    25% { transform: translateY(-50%) translateX(-5px); }
    75% { transform: translateY(-50%) translateX(5px); }
}

/* =========================
   Media Queries - Tablet
   ========================= */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 10px;
    }

    .phantom-grid {
        gap: 25px;
        max-width: min(600px, calc(100vw - 20px));
        padding: 0 15px;
    }

    .logo-container {
        max-width: 400px;
    }

    .install-command {
        font-size: 13px;
    }

    #copyBtn {
        padding: 6px;
        width: 32px;
        height: 32px;
    }

    #copyBtn .phantom-icon {
        width: 14px;
        height: 14px;
    }

    .links-container {
        gap: 15px;
        flex-direction: row;
        padding: 15px 10px 30px;
    }

    .nav-link {
        font-size: 14px;
        padding: 10px 20px;
    }

    /* Feature slider adjustments - uses --content-width */

    .feature-slide {
        padding: 30px 35px 40px 35px;
        gap: 20px;
        min-height: 130px;
    }

    .feature-icon {
        width: 55px;
        height: 55px;
    }

    .feature-icon .phantom-icon {
        width: 24px;
        height: 24px;
    }

    .feature-title {
        font-size: 18px;
    }

    .feature-description {
        font-size: 13px;
    }

    .footer {
        margin-top: 40px;
        padding: 25px 15px;
    }

    .copyright {
        font-size: 12px;
    }

    .copyright-trademark {
        font-size: 10px;
    }
}

/* =========================
   Media Queries - Mobile
   ========================= */
@media (max-width: 480px) {
    .logo-container {
        max-width: 280px;
        margin-bottom: 30px;
    }

    /* All sections now inherit max-width from --content-width */

    .feature-slide {
        padding: 25px 20px;
        gap: 18px;
        flex-direction: column;
        text-align: center;
        min-height: 180px;
        justify-content: center;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 5px;
    }

    .feature-icon .phantom-icon {
        width: 26px;
        height: 26px;
    }

    .feature-content {
        text-align: center;
    }

    .feature-title {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .feature-description {
        font-size: 12px;
        line-height: 1.5;
    }

    .slider-controls {
        bottom: 10px;
        gap: 6px;
    }

    .slider-dot {
        width: 6px;
        height: 6px;
    }

    .slider-dot.active {
        width: 20px;
    }

    .install-container {
        padding: 12px 16px;
    }

    .install-command {
        font-size: 12px;
        padding-right: 45px;
    }

    #copyBtn {
        width: 30px;
        height: 30px;
        right: 8px;
    }

    #copyBtn .phantom-icon {
        width: 12px;
        height: 12px;
    }

    .links-container {
        flex-direction: column;
        gap: 12px;
        align-items: center;
        padding: 10px 10px 20px;
    }

    .nav-link {
        display: block;
        width: 100%;
        text-align: center;
        font-size: 14px;
        padding: 12px 20px;
        max-width: 250px;
    }

    .nav-section {
        padding: 0 0 15px 0;
    }

    .footer {
        margin-top: 30px;
        padding: 20px 10px;
    }

    .copyright {
        font-size: 11px;
    }

    .copyright-trademark {
        font-size: 9px;
    }
}

/* =========================
   Media Queries - Small Mobile
   ========================= */
@media (max-width: 374px) {
    .phantom-grid {
        padding: 0 10px;
        gap: 15px;
        min-height: auto;
        max-width: 100%;
    }

    .logo-section {
        padding: 10px 0 0 0;
    }

    .nav-section {
        padding: 0 0 10px 0;
    }

    .logo-container {
        max-width: 200px;
    }

    .install-section {
        padding: 10px 0;
        /* Using --content-width variable */
    }

    /* modules-section inherits from --content-width */

    .install-container {
        padding: 10px 12px;
    }

    .install-label {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .install-command {
        font-size: 10px;
        padding-right: 40px;
    }

    #copyBtn {
        width: 26px;
        height: 26px;
        right: 6px;
    }

    #copyBtn .phantom-icon {
        width: 10px;
        height: 10px;
    }

    /* Feature Slider adjustments - uses --content-width */
    .feature-slider {
        /* Using --content-width variable */
        padding-bottom: 20px;
    }

    .feature-slide {
        padding: 20px 15px;
        flex-direction: column;
        text-align: center;
        min-height: 140px;
        gap: 12px;
    }

    .feature-icon {
        width: 45px;
        height: 45px;
        margin: 0 auto 8px;
    }

    .feature-icon .phantom-icon {
        width: 20px;
        height: 20px;
    }

    .feature-title {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .feature-description {
        font-size: 11px;
        line-height: 1.4;
    }

    .slider-controls {
        bottom: 8px;
    }

    /* Navigation adjustments */
    .links-container {
        padding: 10px 0 15px;
        gap: 8px;
    }

    .nav-link {
        font-size: 12px;
        padding: 8px 12px;
        width: calc(100% - 20px);
        max-width: 200px;
    }

    .footer {
        margin-top: 20px;
        padding: 15px 10px;
    }

    .copyright {
        font-size: 9px;
    }

    .copyright-trademark {
        font-size: 8px;
        margin-top: 6px;
        padding-top: 6px;
    }
}