/*
  NEW STYLES - AITOOLS AGGREGATOR
  Goal: Modern, elegant, and professional redesign.
*/

/* 1. FONT & VARIABLES
-------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --color-text-base: #374151; /* Gray 700 */
    --color-text-headings: #111827; /* Gray 900 */
    --color-text-muted: #6B7280; /* Gray 500 */
    
    --color-bg-base: #FFFFFF;
    --color-bg-muted: #F9FAFB; /* Gray 50 */
    
    --color-primary: #4F46E5; /* Indigo 600 */
    --color-primary-hover: #4338CA; /* Indigo 700 */
    --color-primary-text: #FFFFFF;

    --color-border: #E5E7EB; /* Gray 200 */

    --color-success-bg: #D1FAE5; /* Green 100 */
    --color-success-text: #065F46; /* Green 800 */
    --color-error-bg: #FEE2E2; /* Red 100 */
    --color-error-text: #991B1B; /* Red 800 */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-md: 0.375rem; /* 6px */
    --radius-lg: 0.5rem; /* 8px */
    --radius-xl: 0.75rem; /* 12px */
}

/* 2. BASE & RESET
-------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color-text-base);
    background: var(--color-bg-muted); /* Set default background to muted */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-headings);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; line-height: 1.2; }
h2 { font-size: 2rem; line-height: 1.25; }
h3 { font-size: 1.5rem; line-height: 1.3; }
h4 { font-size: 1.25rem; line-height: 1.4; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* 3. NAVBAR
-------------------------------------------------- */
.navbar {
    background: var(--color-bg-base);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

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

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-text-headings);
    text-decoration: none;
}

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

.nav-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* 4. BUTTONS
-------------------------------------------------- */
.btn-primary, .btn-secondary, .btn-large {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-primary-text);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    color: var(--color-primary-text);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-base);
    border-color: var(--color-border);
    background-color: var(--color-bg-base);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
    text-align: center;
}


/* 5. LANDING PAGE SECTIONS
-------------------------------------------------- */

/* Hero Section */
.hero {
    background-color: var(--color-bg-muted);
    color: var(--color-text-headings);
    padding: 6rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin: 0 auto 2.5rem auto;
    max-width: 600px;
    line-height: 1.5;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Features Section */
.features-section {
    padding: 5rem 0;
    background-color: var(--color-bg-base);
}

.feature-card {
    background: var(--color-bg-base);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-card .text-3xl {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 1rem;
    display: inline-block;
}

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

.feature-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* "Who It's Built For" Section */
.who-it-s-built-for {
    background: var(--color-bg-muted);
    padding: 5rem 0;
}

.pain-point-card {
    background: var(--color-bg-base);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.pain-point-card h3 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.pain-point-card p {
    color: var(--color-text-muted);
    margin-bottom: 0;
}

/* Pricing Section */
.pricing {
    padding: 5rem 0;
    background-color: var(--color-bg-base);
}

.pricing-grid {
    display: grid;
    justify-content: center;
}

.pricing-card {
    background: var(--color-bg-base);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    text-align: center;
}

.pricing-card.featured {
    border: 2px solid var(--color-primary);
    box-shadow: var(--shadow-lg);
}

.pricing-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.price {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--color-text-headings);
    margin-bottom: 0.5rem;
}

.price span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.pricing-card ul {
    list-style: none;
    margin: 2rem 0;
    text-align: left;
}

.pricing-card li {
    padding: 0.5rem 0;
    color: var(--color-text-base);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* FAQ Section */
.faq-section {
    background-color: var(--color-bg-muted);
    padding: 5rem 0;
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1.5rem;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h4 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.faq-item p {
    color: var(--color-text-muted);
    margin-bottom: 0;
}

/* CTA Section */
.cta-section {
    background-color: var(--color-bg-base);
    padding: 5rem 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.cta-section h2 {
    font-size: 2.25rem;
}

/* 6. APP PAGES (LOGIN, DASHBOARD, SETTINGS)
-------------------------------------------------- */

/* General App Layout */
.dashboard, .settings {
    padding: 3rem 0;
}
.dashboard h1, .settings h1 {
    margin-bottom: 2rem;
}

/* Login Page */
.login-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.login-box {
    background: var(--color-bg-base);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 0.75rem;
}

.login-box > p {
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}
.login-footer p {
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}
.login-footer a {
    font-weight: 500;
}

/* Dashboard Page */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.dashboard-stats {
    display: flex;
    gap: 2.5rem;
}

.stat {
    text-align: right;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.filters {
    background: var(--color-bg-base);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.filters form {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.tools-table-container {
    background: var(--color-bg-base);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    border: 1px solid var(--color-border);
}

.tools-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.tools-table th,
.tools-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.tools-table th {
    background-color: var(--color-bg-muted);
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.tools-table tbody tr:last-child td {
    border-bottom: none;
}

.tools-table tbody tr:hover {
    background-color: var(--color-bg-muted);
}

.tools-table td:last-child {
    white-space: normal;
    min-width: 300px;
}

.source-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid transparent;
}
.source-producthunt { background: #da552f; color: white; border-color: #da552f;}
.source-hackernews { background: #ff6600; color: white; border-color: #ff6600;}
.source-github { background: #333; color: white; border-color: #333;}
.source-taaft { background: #56CCF2; color: white; border-color: #56CCF2;}
.source-toolify { background: #7150e6; color: white; border-color: #10b981;}
.source-topai { background: #006b47; color: white; border-color: #10b981;}


.empty-state {
    background: var(--color-bg-base);
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--color-text-muted);
}

/* Settings Page */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.settings-section {
    background: var(--color-bg-base);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.settings-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

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

.info-group label, .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text-base);
}

.info-group input[readonly] {
    background: var(--color-bg-muted);
}

.form-group input, .form-group select, .form-group textarea,
.info-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background-color: var(--color-bg-base);
    color: var(--color-text-base);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
}
.form-group input[disabled] {
    background: var(--color-bg-muted);
    cursor: not-allowed;
}


.api-key-display {
    display: flex;
    gap: 0.5rem;
}
.api-key-display input {
    font-family: monospace;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-block;
    text-transform: capitalize;
}
.status-active { background: var(--color-success-bg); color: var(--color-success-text); }
.status-canceled { background: var(--color-error-bg); color: var(--color-error-text); }


.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.help-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.docs-links h3, .docs-links h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.docs-links h3 { font-size: 1.125rem; }
.docs-links h4 { font-size: 1rem; color: var(--color-text-base); }

code, pre {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 0.9em;
}

code {
    background: var(--color-bg-muted);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

pre {
    background: #111827; /* Gray 900 */
    color: #E5E7EB; /* Gray 200 */
    padding: 1rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: 1rem 0;
}
pre code {
    background: none;
    border: none;
    padding: 0;
}

.success-message, .error-message {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}
.success-message { background: var(--color-success-bg); color: var(--color-success-text); }
.error-message { background: var(--color-error-bg); color: var(--color-error-text); }

/* Footer */
.footer {
    background: var(--color-text-headings);
    color: var(--color-text-muted);
    padding: 3rem 0;
    text-align: center;
    margin-top: 4rem;
}


/* 7. UTILITY CLASSES
   Supporting classes found in landing.html.
-------------------------------------------------- */
.bg-white { background-color: var(--color-bg-base); }
.bg-gray-50 { background-color: var(--color-bg-muted); }

.border { border: 1px solid var(--color-border); }
.border-2 { border-width: 2px; }
.border-t { border-top: 1px solid var(--color-border); }
.border-primary { border-color: var(--color-primary); }
.border-gray-100 { border-color: var(--color-border); }

.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow-md { box-shadow: var(--shadow-md); }
.transition-shadow { transition: box-shadow 0.2s ease-in-out; }
.hover\:shadow-md:hover { box-shadow: var(--shadow-md); }

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

.font-bold { font-weight: 700; }
.font-normal { font-weight: 400; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.text-muted { font-size: 0.875rem; color: var(--color-text-muted); }
.text-gray-500 { color: var(--color-text-muted); }
.text-gray-600 { color: var(--color-text-base); }
.text-gray-700 { color: var(--color-text-base); }

.leading-relaxed { line-height: 1.625; }

.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-md { max-width: 28rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }

.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.p-6 { padding: 1.5rem; }

.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: calc(0.75rem * (1 - 0)); }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: calc(1.5rem * (1 - 0)); }

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero-cta { flex-direction: column; }
    .dashboard-header { flex-direction: column; align-items: stretch; }
    .dashboard-stats { justify-content: space-around; }
    .stat { text-align: center; }
}

@media (min-width: 768px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
}

@media (min-width: 1024px) {
    h1 { font-size: 3.5rem; }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}