/* ========================================
   JUMBLE SOLVER - Complete Stylesheet
   ======================================== */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #f59e0b;
    --accent: #10b981;
    --danger: #ef4444;
    --dark: #1e1b4b;
    --dark-light: #312e81;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --transition: all 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--dark);
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-accent {
    color: var(--primary);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: var(--gray-100);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-700);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 50%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 3rem 0 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

/* Ad Units */
.ad-unit {
    background: var(--gray-100);
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 0.875rem;
    margin: 1.5rem auto;
    min-height: 90px;
    max-width: 728px;
}

.top-ad {
    margin-bottom: 2rem;
}

.middle-ad {
    margin: 2rem auto;
}

.bottom-ad {
    margin: 2rem auto 3rem;
}

/* Tool Card */
.tool-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    max-width: 700px;
    margin: 0 auto;
}

.tool-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.tool-header h2 {
    font-size: 1.35rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.tool-header p {
    color: var(--gray-500);
    font-size: 0.95rem;
}

/* Input Section */
.input-wrapper {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.jumble-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    color: var(--gray-900);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--transition);
    outline: none;
}

.jumble-input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.jumble-input::placeholder {
    text-transform: none;
    font-weight: 400;
    letter-spacing: normal;
    color: var(--gray-400);
}

.solve-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.solve-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.solve-btn:active {
    transform: translateY(0);
}

.input-options {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.option-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray-600);
    cursor: pointer;
}

.option-toggle input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary);
}

.length-select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-700);
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
}

.length-select:not(:disabled) {
    opacity: 1;
}

/* Results Section */
.results-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    animation: fadeIn 0.3s ease;
}

.results-section.hidden {
    display: none;
}

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.results-header h3 {
    font-size: 1rem;
    color: var(--gray-700);
}

.results-header h3 span {
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.results-count {
    font-size: 0.85rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-group {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
}

.result-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-words {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.result-word {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    letter-spacing: 0.05em;
    transition: var(--transition);
    cursor: pointer;
}

.result-word:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

/* Quick Examples */
.quick-examples {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.quick-examples p {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.example-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.chip {
    padding: 0.4rem 0.875rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* Features Section */
.features {
    padding: 4rem 0;
    background: var(--white);
}

.features h2 {
    text-align: center;
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 2.5rem;
}

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

.feature-card {
    padding: 1.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}

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

.feature-icon {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.feature-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.feature-link:hover {
    color: var(--primary-dark);
}

/* How It Works */
.how-it-works {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
}

.how-it-works h2 {
    text-align: center;
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 2.5rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.step {
    text-align: center;
    padding: 1.5rem;
}

.step-number {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 auto 1rem;
}

.step h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* FAQ Section */
.faq {
    padding: 4rem 0;
    background: var(--white);
}

.faq h2 {
    text-align: center;
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 2.5rem;
}

.faq-list {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.faq-question:hover {
    background: var(--gray-100);
}

.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--primary);
    transition: var(--transition);
}

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

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

.faq-item.active .faq-answer {
    max-height: 200px;
}

.faq-answer p {
    padding: 0 1.25rem 1rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* Footer */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 3rem 0 1.5rem;
}

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

.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 0.75rem;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 300px;
}

.footer-links h4 {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

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

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

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

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

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
}

/* Content Pages */
.content-page {
    padding: 3rem 0;
}

.content-page h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.content-page h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 2rem 0 0.75rem;
}

.content-page h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 1.5rem 0 0.5rem;
}

.content-page p {
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.content-page ul,
.content-page ol {
    margin: 0.75rem 0 1rem 1.5rem;
    color: var(--gray-600);
}

.content-page li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.content-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.breadcrumb {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

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

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Tip Box */
.tip-box {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin: 1rem 0;
}

.tip-box strong {
    color: #065f46;
}

.tip-box p {
    color: #065f46;
    margin: 0;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

.data-table tr:hover {
    background: var(--gray-50);
}

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

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--gray-200);
    }

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

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

    .hero-subtitle {
        font-size: 1rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .solve-btn {
        justify-content: center;
    }

    .tool-card {
        padding: 1.25rem;
    }

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

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

    .footer-brand {
        grid-column: 1 / -1;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0 1.5rem;
    }

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

    .feature-card {
        padding: 1.25rem;
    }

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

    .ad-unit {
        min-height: 50px;
    }
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
