/* ===== CORE & BASE STYLES ===== */
:root {
    /* Light Theme */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f59e0b;
    --accent-color: #ec4899;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 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);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Dark Theme */
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
    --secondary-color: #fbbf24;
    --accent-color: #f472b6;
    --text-color: #f9fafb;
    --text-light: #d1d5db;
    --bg-color: #111827;
    --bg-secondary: #1f2937;
    --bg-card: #1f2937;
    --border-color: #374151;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-container {
    min-height: 70vh;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ===== BUTTONS (Only used in index.php) ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #d97706;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-tool {
    width: 100%;
    margin-top: 1rem;
}

/* ===== HEADER & NAVIGATION ===== */
.navbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: translateY(-2px);
    color: var(--primary-color);
}

.logo-icon {
    font-size: 2.2rem;
    display: inline-block;
    animation: playfulWink 4s infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

@keyframes playfulWink {
    0%, 90%, 100% {
        transform: scale(1) rotate(0deg);
    }
    92% {
        transform: scale(1.1) rotate(-5deg);
    }
    96% {
        transform: scale(1.1) rotate(5deg);
    }
}

.logo-text {
    font-weight: 800;
    font-size: 1.8rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4a6fa5 0%, #6a8bc5 50%, #8babf0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Dark Mode Logo Support */
[data-theme="dark"] .logo-text {
    background: linear-gradient(135deg, #6a8bc5 0%, #8babf0 50%, #a0c1ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-light);
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    z-index: 1001;
}

.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

#themeToggle {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

#themeToggle:hover {
    transform: scale(1.1);
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 1000;
    display: none;
    padding: 2rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 300px;
}

.mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    z-index: 1001;
    padding: 0.5rem;
}

.mobile-menu-close:hover {
    color: var(--primary-color);
}

.mobile-nav-link {
    padding: 1rem;
    font-size: 1.25rem;
    color: var(--text-color);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    text-decoration: none;
}

.mobile-nav-link:hover {
    color: var(--primary-color);
    transform: translateX(10px);
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

/* Mobile Menu Logo */
.mobile-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

/* ===== FOOTER ===== */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 30px 0;
    text-align: center;
    border-top: 3px solid #4a6fa5;
}

.footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

[data-theme="dark"] .footer {
    background: #1a1a2e;
}

.footer-brand {
    margin-bottom: 20px;
}

.footer-emoji {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

.footer-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: #FFD166;
    display: block;
    margin-bottom: 5px;
}

.footer-tagline {
    font-size: 0.9rem;
    color: #bdc3c7;
    font-style: italic;
}

.footer-links {
    margin: 25px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-link {
    color: #ecf0f1;
    text-decoration: none;
    padding: 5px 10px;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.footer-link:hover {
    color: #FFD166;
}

.divider {
    color: #7f8c8d;
    font-size: 1.2rem;
}

.footer-bottom {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: #95a5a6;
}

.footer-note {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #4a6fa5;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #FF6B6B;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .back-to-top {
    background: #FF6B6B;
}

/* ===== HOMEPAGE SPECIFIC STYLES ===== */
.homepage {
    padding-top: 1rem;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-color) 100%);
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.hero-title .highlight {
    color: var(--primary-color);
    position: relative;
}

.hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Section Titles */
.section-title {
    text-align: center;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Router Section */
.router-section {
    padding: 4rem 0;
    background: var(--bg-color);
}

.router-card {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.router-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.router-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 110px;
    transition: var(--transition);
    background: var(--bg-color);
    color: var(--text-color);
}

.router-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.router-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.example-chip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    border: none;
}

.example-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-color);
}

.router-note {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Ad Sections */
.ad-section {
    margin: 2rem 0;
}

.ad-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-728 {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.ad-300 {
    display: flex;
    justify-content: center;
    margin: 2.5rem 0;
}

/* Tools Grid */
.tools-grid {
    padding: 4rem 0;
}

.tools-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tool-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-stats {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Features */
.features {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* SEO Content Section */
.seo-content-section {
    padding: 5rem 0;
    background: var(--bg-color);
}

.seo-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.seo-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.seo-intro {
    font-size: 1.125rem;
    color: var(--text-light);
    line-height: 1.7;
}

.seo-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.seo-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.seo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.seo-card-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.seo-icon {
    font-size: 2rem;
    background: var(--bg-secondary);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seo-card-header h3 {
    margin: 0;
    color: var(--text-color);
}

.seo-card-body {
    padding: 1.5rem;
}

.seo-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.seo-list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.seo-list-item:last-child {
    border-bottom: none;
}

.list-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.benefit-icon {
    font-size: 1.25rem;
}

/* SEO Article */
.seo-article {
    max-width: 800px;
    margin: 0 auto;
}

.seo-article h3 {
    margin: 2.5rem 0 1rem;
    color: var(--text-color);
    font-size: 1.75rem;
}

.seo-article p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.highlight-box {
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    margin: 2rem 0;
}

.highlight-box p {
    margin: 0;
    color: var(--text-color);
}

/* Help Cards */
.help-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.help-card {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.help-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.help-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.help-card h4 {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.help-card p {
    font-size: 0.875rem;
    margin: 0;
    color: var(--text-light);
}

/* FAQ Section */
.faq-section {
    padding: 5rem 0;
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.faq-grid {
    max-width: 800px;
    margin: 0 auto;
}

.faq-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: var(--transition);
}

.faq-card:hover {
    border-color: var(--primary-color);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    user-select: none;
}

.faq-question h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-color);
}

.faq-toggle {
    background: var(--bg-secondary);
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.faq-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.faq-card.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-card.active .faq-answer {
    padding: 0 1.5rem 1.5rem;
    max-height: 500px;
}

.faq-answer p {
    margin: 0;
    color: var(--text-light);
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    padding: 5rem 0;
    text-align: center;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content > p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 992px) {
    .logo-icon {
        font-size: 1.8rem;
    }
    .logo-text {
        font-size: 1.5rem;
    }
    
    .ad-728 {
        display: none;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .tools-container {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .seo-content-grid {
        grid-template-columns: 1fr;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .help-cards {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
    }
    
    .logo-icon {
        font-size: 1.6rem;
    }
    .logo-text {
        font-size: 1.3rem;
    }
    
    .router-examples {
        flex-direction: column;
        align-items: stretch;
        margin-top: 0.5rem;
    }
    
    .example-chip {
        width: 100%;
        text-align: center;
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
        border-radius: var(--radius-sm);
    }
    
    .router-form .btn {
        width: 100%;
        max-width: none;
        font-size: 1.1rem;
        padding: 1rem;
    }
    
    .router-card {
        padding: 2rem 1.5rem;
    }
    
    /* Hide desktop ads on mobile */
    .ad-desktop {
        display: none !important;
    }
    
    /* Show mobile ads */
    .ad-mobile {
        display: block;
    }
    
    .cta-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .logo {
        gap: 6px;
    }
    .logo-icon {
        font-size: 1.4rem;
    }
    .logo-text {
        font-size: 1.1rem;
    }
    
    .seo-card-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .faq-question {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .faq-toggle {
        align-self: flex-end;
    }
    
    .router-card {
        padding: 1.75rem 1.25rem;
    }
    
    .router-textarea {
        font-size: 1rem;
        min-height: 120px;
    }
}