/* ============================================
   PhaseBot - Modern Dark Theme
   ============================================ */

/* CSS Variables for theming */
:root {
    --primary: #5865F2;
    --primary-dark: #4752C4;
    --secondary: #EB459E;
    --accent: #57F287;
    --bg-dark: #0B0C10;
    --bg-card: #1A1B1E;
    --bg-card-hover: #25262B;
    --text-primary: #FFFFFF;
    --text-secondary: #B9BBBE;
    --text-muted: #72767D;
    --border: #2E2F33;
    --success: #57F287;
    --warning: #FEE75C;
    --danger: #ED4245;
    --info: #5865F2;
    --gradient-1: linear-gradient(135deg, #5865F2 0%, #EB459E 100%);
    --gradient-2: linear-gradient(135deg, #0B0C10 0%, #1A1B1E 100%);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.7);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary);
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(88, 101, 242, 0.6);
    color: white;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    background: rgba(11, 12, 16, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(46, 47, 51, 0.5);
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 0.75rem 0;
    background: rgba(11, 12, 16, 0.95);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 8rem 0 4rem;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0) 100%);
}

.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}

.hero-content {
    text-align: center;
    max-width: 900px;
    padding: 0 2rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(88, 101, 242, 0.15);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease-out;
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero h1 {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero h1 .gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 4rem;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.hero-stat {
    text-align: center;
    padding: 1.5rem;
    background: rgba(26, 27, 30, 0.6);
    border: 1px solid var(--border);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.hero-stat:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.2);
}

.hero-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   Features Section
   ============================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(88, 101, 242, 0.1);
    border-radius: 1rem;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0;
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: rgba(88, 101, 242, 0.1);
    border: 1px solid rgba(88, 101, 242, 0.2);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--primary);
}

/* ============================================
   Commands Section
   ============================================ */
.commands-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
}

.commands-header {
    padding: 2rem;
    background: rgba(88, 101, 242, 0.05);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.commands-search {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.commands-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
}

.commands-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}

.command-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    white-space: nowrap;
}

.command-tab:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.command-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.commands-list {
    padding: 2rem;
    max-height: 600px;
    overflow-y: auto;
}

.command-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.command-item:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.command-syntax {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.95rem;
    color: var(--accent);
    background: rgba(87, 242, 135, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    min-width: 200px;
    text-align: center;
}

.command-details h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.command-details p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.command-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(88, 101, 242, 0.1);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* ============================================
   Stats Section
   ============================================ */
.stats-section {
    background: var(--gradient-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.stat-card {
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.15);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   FAQ Section
   ============================================ */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: var(--transition);
    opacity: 1;
    transform: none;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--primary);
}

.faq-icon {
    font-size: 1.5rem;
    transition: var(--transition);
    color: var(--primary);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-answer-content {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================
   CTA Section
   ============================================ */
.cta-section {
    background: var(--gradient-1);
    padding: 5rem 0;
    text-align: center;
}

.cta-section h2 {
    margin-bottom: 1rem;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn-white {
    background: white;
    color: var(--primary);
    padding: 1rem 2.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.cta-btn-white:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: var(--primary);
}

.cta-btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 1rem 2.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.cta-btn-outline:hover {
    border-color: white;
    transform: translateY(-3px);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

.footer-links h4 {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-3px);
}

/* ============================================
   404 Page
   ============================================ */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: var(--bg-dark);
}

.error-content {
    max-width: 600px;
}

.error-code {
    font-size: 10rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.error-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .commands-header {
        flex-direction: column;
        align-items: stretch;
    }

    .commands-tabs {
        padding: 1rem;
    }

    .command-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .command-syntax {
        white-space: normal;
        min-width: auto;
    }

    .section {
        padding: 4rem 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-stat-value {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 2.5rem;
    }

    .error-code {
        font-size: 6rem;
    }
}

/* ============================================
   Scroll Animations
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ============================================
   Selection
   ============================================ */
::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}