/* ==========================================
   ULTIMATE TOOLS — Premium Design System v2
   ========================================== */

:root {
    /* Primary Palette — Logo Colors: Blue-to-Purple Gradient */
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --secondary: #2563eb;
    --accent: #a855f7;

    /* Light Mode (Default) */
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-footer: #f1f5f9;
    --bg-hover: #f3e8ff;
    --text-main: #0f1b4d;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --glass-bg: rgba(241, 245, 249, 0.6);
    --glass-border: rgba(148, 163, 184, 0.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 40px -12px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --hero-bg: radial-gradient(ellipse at 30% 0%, rgba(124, 58, 237, 0.08) 0%, transparent 60%),
               radial-gradient(ellipse at 70% 0%, rgba(37, 99, 235, 0.06) 0%, transparent 60%);
    --radius: 1rem;
    --radius-lg: 1.5rem;
}

body.dark-mode {
    --bg-dark: #0a0e1f;
    --bg-card: rgba(15, 27, 77, 0.35);
    --bg-header: rgba(10, 14, 31, 0.88);
    --bg-footer: #060a1a;
    --bg-hover: rgba(124, 58, 237, 0.12);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.12);
    --glass-bg: rgba(15, 27, 77, 0.3);
    --glass-border: rgba(148, 163, 184, 0.08);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 40px -12px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.2);
    --hero-bg: radial-gradient(ellipse at 30% 0%, rgba(124, 58, 237, 0.15) 0%, transparent 60%),
               radial-gradient(ellipse at 70% 0%, rgba(37, 99, 235, 0.10) 0%, transparent 60%);
}

/* ==========================================
   GLOBAL RESETS
   ========================================== */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 75px; /* Added to prevent overlap with fixed header */
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

/* ==========================================
   HEADER — Frosted Glass Navigation
   ========================================== */
header {
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.875rem 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

#themeToggle {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.6rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    transition: var(--transition);
}

#themeToggle:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: rotate(15deg);
    color: var(--primary);
}

.logo {
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.logo-img {
    height: 65px;
    width: auto;
    display: block;
    transition: var(--transition);
}

.logo:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 1.75rem;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
    position: relative;
    padding-bottom: 2px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 99px;
    transition: width 0.3s ease;
}

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

.nav-links a:hover::after {
    width: 100%;
}

/* ==========================================
   HERO SECTION — Homepage
   ========================================== */
.hero {
    padding: 7rem 0 5rem;
    text-align: center;
    background: var(--hero-bg);
    position: relative;
}

.hero h1 {
    font-size: 3.75rem;
    font-weight: 900;
    margin-bottom: 1.25rem;
    letter-spacing: -1.5px;
    line-height: 1.1;
}

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

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 1.25rem 3.5rem 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

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

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ==========================================
   TOOL GRID — Card System
   ========================================== */
.category-section {
    padding: 4rem 0 2rem;
    scroll-margin-top: 85px;
}

.category-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
}

.category-title i {
    color: var(--primary);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(124, 58, 237, 0.1);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-icon {
    font-size: 1.5rem;
    color: var(--primary);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(37, 99, 235, 0.08));
    border-radius: 0.75rem;
}

.tool-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.tool-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ==========================================
   TOOL PAGE — Individual Tool Layouts
   ========================================== */
.tool-page-header {
    padding: 4rem 0 2rem;
}

.tool-page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.tool-page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.tool-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-sm);
}

.tool-interface {
    margin-top: 2rem;
}

/* ==========================================
   SEO CONTENT — Long-form Sections
   ========================================== */
.seo-content {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
}

.seo-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.seo-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2.5rem 0 1.25rem;
    letter-spacing: -0.3px;
}

.seo-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
}

.seo-content p {
    margin-bottom: 1.25rem;
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1.025rem;
}

.seo-content ul, .seo-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

.seo-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.faq-section {
    margin-top: 4rem;
}

.faq-item {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.faq-question {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.faq-answer {
    color: var(--text-muted);
    line-height: 1.7;
}

/* ==========================================
   FORM ELEMENTS — Inputs, Buttons, Selects
   ========================================== */
textarea, input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    outline: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

textarea:focus, input[type="text"]:focus, input[type="number"]:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

button:hover {
    background: linear-gradient(135deg, var(--primary-hover), #5b21b6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

button:active {
    transform: translateY(0);
}

/* ==========================================
   FOOTER — Rich Layout
   ========================================== */
footer {
    background: var(--bg-footer);
    padding: 5rem 0 2rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

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

.footer-logo {
    margin-bottom: 1rem;
    display: inline-block;
}

.footer-links h4 {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

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

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ==========================================
   UTILITIES
   ========================================== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   ABOUT PAGE — Premium Sections
   ========================================== */
.stat-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
    padding: 3rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2rem;
    color: white;
    text-align: center;
    box-shadow: 0 10px 40px rgba(124, 58, 237, 0.35);
}

.stat-item h2 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: white !important;
}

.stat-item p {
    color: rgba(255,255,255,0.85) !important;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.persona-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.persona-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

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

.persona-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.persona-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.persona-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==========================================
   RESPONSIVE — Mobile & Tablet
   ========================================== */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.1rem; }
    .nav-links { display: none; }
    .tool-page-header h1 { font-size: 2rem; }
    .seo-content h1 { font-size: 1.75rem; }
    .seo-content h2 { font-size: 1.5rem; }
    .stat-bar { padding: 2rem; border-radius: 1.5rem; }
    .stat-item h2 { font-size: 2.5rem; }
    .tool-container { padding: 1.5rem; }
    footer { padding: 3rem 0 1.5rem; }
}

/* ==========================================
   RELATED TOOLS — Bottom of Tool Pages
   ========================================== */
.related-tools {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 3rem 1.5rem;
}

.related-tools h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-main);
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.related-tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
}

.related-tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.related-tool-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(124, 58, 237, 0.1);
}

.related-tool-card:hover::before {
    opacity: 1;
}

.related-tool-card .rt-icon {
    font-size: 1.35rem;
    color: var(--primary);
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(37, 99, 235, 0.08));
    border-radius: 0.75rem;
}

.related-tool-card .rt-info .rt-name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 0.15rem;
}

.related-tool-card .rt-info .rt-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero { padding: 4rem 0 3rem; }
    .hero h1 { font-size: 2rem; }
    .container { padding: 0 1rem; }
    .tool-grid { grid-template-columns: 1fr; }
    .stat-bar { grid-template-columns: 1fr; gap: 1.5rem; }
}
