/**
 * ToolKit India — Modern Design System & Responsive Stylesheet
 * 50+ Working Online Tools Website
 */

:root {
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Light Theme Palette */
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-input: #f1f5f9;
    --bg-input-focus: #ffffff;
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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-glow: 0 0 25px rgba(37, 99, 235, 0.15);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --header-height: 72px;
}

[data-theme="dark"] {
    --bg-page: #0b0f19;
    --bg-surface: #111827;
    --bg-surface-elevated: #1e293b;
    --bg-input: #0f172a;
    --bg-input-focus: #1e293b;
    --border-color: #1f2937;
    --border-focus: #60a5fa;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;

    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.15);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.2);
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

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

/* Layout Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* Header & Navigation */
.site-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s;
}

.header-inner {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.brand-badge {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

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

.nav-links a {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0.25rem;
    position: relative;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-theme-toggle {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
}

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    padding: 3.5rem 0 2.5rem;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-page) 100%);
    border-bottom: 1px solid var(--border-color);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1.15;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 2rem;
}

/* Hero Live Search */
.hero-search-wrapper {
    max-width: 640px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0.35rem 0.5rem 0.35rem 1.25rem;
    box-shadow: var(--shadow-lg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.05rem;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.btn-search {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.2s;
}

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

/* Live Autocomplete Results */
.live-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
    max-height: 380px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    text-align: left;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s;
}

.search-result-item:hover, .search-result-item.selected {
    background: var(--primary-light);
}

/* Category Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.category-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.category-icon { font-size: 2rem; }
.category-name { font-weight: 700; font-size: 0.95rem; }
.category-count { font-size: 0.8rem; color: var(--text-muted); }

/* Tools Cards Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.tool-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.tool-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.tool-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tool-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}

.tool-category-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
    display: inline-block;
}

.tool-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.btn-use-tool {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.65rem 1.2rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    transition: all 0.2s;
    border: none;
}

.tool-card:hover .btn-use-tool {
    background: var(--primary);
    color: #fff;
}

/* Tool Runner Workspace */
.tool-workspace {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2.5rem;
}

/* Dropzone Upload Box */
.dropzone-box {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: var(--bg-input);
    cursor: pointer;
    transition: all 0.2s;
}

.dropzone-box:hover, .dropzone-box.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

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

/* Tool Form Controls */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.4rem; color: var(--text-primary); }

.tool-input, .tool-textarea, .tool-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.tool-input:focus, .tool-textarea:focus, .tool-select:focus {
    border-color: var(--primary);
    background: var(--bg-input-focus);
}

.tool-btn {
    background: var(--primary);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

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

.tool-btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.tool-btn-secondary:hover { background: var(--border-color); }

/* Ads Containers */
.ad-container {
    margin: 2rem auto;
    text-align: center;
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.ad-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

/* Footer */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    padding: 3.5rem 0 2rem;
}

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

.footer-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-links a:hover { color: var(--primary); }

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 1rem;
}

/* Mobile Responsive Adjustments */
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
    .hero-title { font-size: 2rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .tool-workspace { padding: 1.25rem; }
}
