/* CSS Custom Properties for Theming */
:root {
    /* Colors - Dark Premium Theme */
    --bg-color: #0b1120;
    --bg-secondary: #111827;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Brand Colors for Accents */
    --accent-primary: #4f46e5;
    --accent-primary-hover: #6366f1;
    --accent-secondary: #0ea5e9;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    
    /* Switch2Go High Contrast UI Colors for visual */
    --cvi-red: #ef4444;
    --cvi-blue: #3b82f6;
    --cvi-yellow: #f59e0b;
    --cvi-green: #10b981;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Layout */
    --max-width: 1200px;
    --nav-height: 80px;
    
    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Dynamic Background Blob */
.blob-bg {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    max-width: 800px;
    max-height: 800px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, rgba(11, 17, 32, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(40px);
    animation: blobAnim 20s infinite alternate;
}

.blob-bg::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -50%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, rgba(11, 17, 32, 0) 70%);
    border-radius: 50%;
}

@keyframes blobAnim {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 10%) scale(1.1); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-center { text-align: center; }

/* Components */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.container-sm { max-width: 800px; }
.container-md { max-width: 900px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-family: var(--font-body);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Glassmorphism Classes */
.glass {
    background: rgba(11, 17, 32, 0.6);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}

.glass-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    padding: var(--spacing-xl);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s;
}

/* Sections */
.section {
    padding: 6rem 0;
}

.pt-32 {
    padding-top: 8rem;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 4.5rem);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.badges {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-android {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-ios {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.hero-cta {
    display: flex;
    gap: 1rem;
}

/* Hero Visual / Mock UI */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.visual-card {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 9/16;
    display: flex;
    flex-direction: column;
    position: relative;
}

.mock-ui {
    background: var(--bg-secondary);
    border-radius: 12px;
    height: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mock-header {
    display: flex;
    gap: 6px;
}

.mock-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.mock-dot.red { background: #ff5f56; }
.mock-dot.yellow { background: #ffbd2e; }
.mock-dot.green { background: #27c93f; }

.mock-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
}

.mock-tile {
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.tile-red { background-color: var(--cvi-red); }
.tile-blue { background-color: var(--cvi-blue); }
.tile-yellow { background-color: var(--cvi-yellow); }
.tile-green { background-color: var(--cvi-green); }

.floating-badge {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.badge-1 {
    top: 20%;
    left: -20px;
    animation: float 6s ease-in-out infinite;
}

.badge-2 {
    bottom: 30%;
    right: -20px;
    animation: float 5s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Features Section */
.section-header {
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
}

.section-header p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2rem;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Image Tool */
.image-tool-card {
    padding: 2rem;
}

.image-tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.tool-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-weight: 600;
    color: #e2e8f0;
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group select {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
}

.form-group input[type="file"] {
    cursor: pointer;
}

.wikimedia-search-row {
    display: flex;
    gap: 0.75rem;
}

.wikimedia-search-row .btn {
    white-space: nowrap;
}

.wikimedia-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 0.65rem;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.25rem;
}

.wikimedia-result-item {
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 0.4rem;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.wikimedia-result-item.active {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.25);
}

.wikimedia-result-item img {
    width: 100%;
    height: 78px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.4rem;
}

.wikimedia-result-item span {
    display: block;
    font-size: 0.75rem;
    color: #cbd5e1;
    line-height: 1.3;
}

.outline-toggle-row {
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
}

.outline-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.outline-controls input[type="range"] {
    width: 100%;
}

.form-group select {
    cursor: pointer;
    appearance: auto;
}

#outline-thickness-value {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tool-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn.disabled {
    pointer-events: none;
    opacity: 0.55;
}

.tool-status {
    color: var(--text-secondary);
}

.tool-preview {
    display: grid;
    gap: 1rem;
}

.preview-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1rem;
    min-height: 280px;
}

.preview-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.preview-panel img {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 10px;
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.07) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.07) 75%), linear-gradient(45deg, rgba(255, 255, 255, 0.07) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.07) 75%);
    background-position: 0 0, 8px 8px;
    background-size: 16px 16px;
    display: none;
}

.preview-panel img.visible {
    display: block;
}

.preview-placeholder {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

/* Privacy Policy Content Formatting */
/* Policy content visible by default - avoids IntersectionObserver issues in small popups (e.g. App Store) */
.page-privacy .policy-card.fade-in-up {
    opacity: 1;
    transform: none;
}

.policy-card {
    margin-bottom: 4rem;
}

.policy-header {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 2rem;
}

.last-updated {
    color: var(--text-secondary);
    font-weight: 500;
}

.prose {
    color: var(--text-primary);
}

.prose h3 {
    font-size: 1.5rem;
    color: var(--accent-secondary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.prose h4 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
}

.prose p {
    margin-bottom: 1.25rem;
    color: #cbd5e1;
}

.prose ul, .prose ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: #cbd5e1;
}

.prose li {
    margin-bottom: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table th, .table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

/* Footer */
.footer {
    background: rgba(11, 17, 32, 0.8);
    border-top: 1px solid var(--glass-border);
    padding-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 1rem;
    max-width: 400px;
}

.footer-links h4 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    border-top: 1px solid var(--glass-border);
    padding: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* Responsive Design */
@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-subtitle {
        margin: 0 auto 2.5rem;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-visual {
        margin-top: 2rem;
    }

    .image-tool-grid,
    .outline-controls {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 2rem 0;
        border-bottom: 1px solid var(--glass-border);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}
