/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #ec4899;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --secondary: #f472b6;
    --nav-bg: rgba(15, 23, 42, 0.85);
    --card-bg: #1e293b;
    --border: #334155;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* Glassmorphism Header */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s, border 0.3s;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

.theme-toggle, .mobile-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.theme-toggle:hover, .mobile-toggle:hover {
    background-color: var(--border);
}

.mobile-toggle {
    display: none;
}

/* Hero Section */
.hero {
    max-width: 1000px;
    margin: 6rem auto 4rem;
    text-align: center;
    padding: 0 2rem;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: #ffffff;
    padding: 0.875rem 1.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn-secondary:hover {
    background-color: var(--card-bg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

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

/* Grid Sections */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

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

/* Steps Section */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    position: relative;
}

.step-card {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

/* Testimonials */
.testimonial-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-muted);
}

/* Score Indicators */
.score-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.score-box {
    flex: 1;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.score-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Variation Tabs */
.variations-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.variation-tab {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 0.25rem;
    transition: all 0.2s;
}

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

/* Tool Interface */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 992px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

/* Result Area */
.result-area {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.result-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

.result-content {
    flex-grow: 1;
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    white-space: pre-wrap;
    overflow-y: auto;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Loading Animation Enhanced */
.ai-loader-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: var(--text-muted);
}

.loader-bar {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

.loader-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: var(--primary);
    border-radius: 2px;
    animation: loader-slide 1.5s infinite ease-in-out;
}

@keyframes loader-slide {
    0% { left: -30%; }
    100% { left: 100%; }
}

.loader-text {
    font-weight: 500;
    animation: pulse 1.5s infinite;
}

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

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

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
}

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

.footer-col ul li a {
    color: var(--text-muted);
}

.footer-col ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--card-bg);
        flex-direction: column;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-toggle {
        display: block;
    }
}
