/* DevAPI Hub - Modern CSS */

:root {
    /* Color Palette */
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #ec4899;
    --text-main: #111827;
    --text-muted: #6b7280;
    --bg-white: #ffffff;
    --bg-light: #f9fafb;
    --bg-surface: #f3f4f6;
    --border-color: #e5e7eb;
    
    /* Accents */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Layout */
    --container-width: 1200px;
    --header-height: 70px;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
}

/* Dark Mode Variables */
.dark {
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --bg-white: #1f2937;
    --bg-light: #111827;
    --bg-surface: #374151;
    --border-color: #4b5563;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Text Selection */
::selection {
    background: rgba(79, 70, 229, 0.2);
    color: inherit;
}

::-moz-selection {
    background: rgba(79, 70, 229, 0.2);
    color: inherit;
}

/* Code Block Selection - Prevent looking selected */
pre::selection,
code::selection,
pre code::selection,
.code-block::selection,
.code-block code::selection,
.code-example pre::selection,
.code-example code::selection {
    background: rgba(79, 70, 229, 0.3);
    color: #e2e8f0;
}

pre::-moz-selection,
code::-moz-selection,
pre code::-moz-selection,
.code-block::-moz-selection,
.code-block code::-moz-selection,
.code-example pre::-moz-selection,
.code-example code::-moz-selection {
    background: rgba(79, 70, 229, 0.3);
    color: #e2e8f0;
}

/* Remove default selection styling from code blocks */
pre,
code,
.code-block,
.code-block code,
.code-example pre,
.code-example code {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utility Classes */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white !important;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--text-muted);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: var(--text-main);
    background: var(--bg-light);
}

/* Navbar */
.navbar {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dark .navbar {
    background: rgba(31, 41, 55, 0.9);
}

.navbar .container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.dark .nav-brand a {
    color: var(--text-main);
}

.brand-icon {
    color: var(--primary-color);
    font-size: 1.75rem;
}

.nav-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a, .nav-auth a.nav-link {
    font-weight: 500;
    color: var(--text-muted);
}

.nav-menu a:hover, .nav-auth a.nav-link:hover {
    color: var(--primary-color);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 2rem;
    border-left: 1px solid var(--border-color);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-main);
    margin: 5px 0;
    transition: 0.3s;
}

.dark .mobile-menu-toggle span {
    background-color: var(--text-main);
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    font-size: 1rem;
    position: relative;
}

.dark-mode-toggle:hover {
    background: var(--border-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.dark-mode-toggle:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.dark-mode-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.dark .dark-mode-toggle:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.dark-mode-toggle i {
    transition: transform 0.3s ease, color 0.2s ease;
    color: var(--text-main);
}

.dark-mode-toggle:hover i {
    transform: rotate(15deg) scale(1.1);
}

.dark .dark-mode-toggle {
    background: var(--bg-surface);
    color: var(--text-main);
}

.dark .dark-mode-toggle:hover {
    background: var(--border-color);
}

/* Hero Section */
.hero {
    padding: 6rem 0;
    background: linear-gradient(to bottom right, #f3f4f6, #ffffff);
    overflow: hidden;
    transition: background 0.2s ease;
}

.dark .hero {
    background: linear-gradient(to bottom right, #1f2937, #111827);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dark .hero-content h1 {
    background: linear-gradient(135deg, #f9fafb 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.stat-item h4 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.stat-item span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.hero-image {
    position: relative;
}

.hero-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    height: auto;
}

.hero-blob {
    position: absolute;
    top: -10%;
    right: -10%;
    width: 120%;
    height: 120%;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
}

/* Features Section */
.features {
    padding: 6rem 0;
    background: var(--bg-white);
    transition: background-color 0.2s ease;
}

.dark .features {
    background: var(--bg-white);
}

.section-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.dark .section-header h2 {
    color: var(--text-main);
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-muted);
}

.dark .section-header p {
    color: var(--text-muted);
}

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

.feature-card {
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.dark .feature-card {
    background: var(--bg-white);
    border-color: var(--border-color);
}

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

.feature-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-muted);
}

/* API Catalog Preview */
.catalog-preview {
    padding: 6rem 0;
    background: var(--bg-surface);
    transition: background-color 0.2s ease;
}

.dark .catalog-preview {
    background: var(--bg-surface);
}

.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.api-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dark .api-card {
    background: var(--bg-white);
    border-color: var(--border-color);
}

.api-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.api-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.api-icon-box {
    width: 48px;
    height: 48px;
    background: var(--bg-surface);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.api-info h3 {
    font-size: 1.125rem;
    margin: 0;
}

.api-category {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.api-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.api-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* CTA Section */
.cta-section {
    padding: 6rem 0;
    background: var(--text-main);
    color: var(--bg-white);
    text-align: center;
    transition: background-color 0.2s ease;
}

.dark .cta-section {
    background: var(--text-main);
}

.cta-container {
    max-width: 800px;
    margin: 0 auto;
}

.cta-container h2 {
    color: var(--bg-white);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.dark .cta-container h2 {
    color: var(--bg-white);
}

.cta-container p {
    color: var(--bg-white);
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
}

.dark .cta-container p {
    color: var(--bg-white);
}

.cta-section .btn {
    background: var(--bg-white) !important;
    color: var(--primary-color) !important;
}

.dark .cta-section .btn {
    background: var(--bg-white) !important;
    color: var(--primary-color) !important;
}

.cta-section .btn:hover {
    background: var(--bg-white) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Footer */
.footer {
    background: var(--bg-white);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-color);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dark .footer {
    background: var(--bg-white);
    border-top-color: var(--border-color);
}

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

.footer-brand p {
    color: var(--text-muted);
    margin: 1rem 0;
    max-width: 300px;
}

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

.social-links a {
    color: var(--text-muted);
    font-weight: 500;
}

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

.footer-links h5 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin-bottom: 1.25rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }

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

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu-wrapper {
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 2rem;
        gap: 2rem;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-150%);
        transition: transform 0.3s ease-in-out, background-color 0.2s ease, border-color 0.2s ease;
        z-index: 90;
    }

    .dark .nav-menu-wrapper {
        background: var(--bg-white);
        border-bottom-color: var(--border-color);
    }

    .nav-menu-wrapper.active {
        transform: translateY(0);
        box-shadow: var(--shadow-lg);
    }

    .nav-menu {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .nav-auth {
        flex-direction: column;
        padding-left: 0;
        border-left: none;
        width: 100%;
        padding-top: 1.5rem;
        border-top: 1px solid var(--border-color);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand p {
        margin-left: auto;
        margin-right: auto;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .dark-mode-toggle {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.9rem;
    }
}
