:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #7C3AED;
    --accent: #06B6D4;
    --success: #10B981;
    --error: #EF4444;
    --bg: #F8FAFC;
    --bg-surface: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --font-family: 'Inter', sans-serif;
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --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);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg: #0F172A;
    --bg-surface: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #334155;
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color var(--transition), color var(--transition);
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, select, textarea {
    font-family: inherit;
    outline: none;
    border: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-main);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
p { margin-bottom: 1rem; color: var(--text-muted); }

/* Layout & Containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.text-center { text-align: center; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav-links a {
    font-weight: 500;
    color: var(--text-main);
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    cursor: pointer;
    color: var(--text-main);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: var(--transition);
}
.theme-toggle:hover {
    background: var(--border);
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    background: none;
    cursor: pointer;
    color: var(--text-main);
    font-size: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-2px);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: var(--shadow-md);
}
.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}


/* Hero Section */
.hero {
    padding: 10rem 0 6rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.1;
    z-index: -1;
    border-radius: 50%;
    filter: blur(60px);
}

.hero h1 {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

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

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.card-icon {
    width: 50px;
    height: 50px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-main);
    transition: var(--transition);
    font-size: 1rem;
}

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

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748B%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.65rem auto;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--primary);
}

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

.tool-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: sticky;
    top: 90px;
    height: calc(100vh - 110px);
    overflow-y: auto;
}
.tool-sidebar::-webkit-scrollbar {
    width: 6px;
}
.tool-sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 10px;
}

.tool-main {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.tool-actions {
    display: flex;
    gap: 0.5rem;
}

.tool-editor {
    flex-grow: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    background: var(--bg);
    min-height: 400px;
    overflow-y: auto;
    font-size: 1.05rem;
    line-height: 1.7;
}

.tool-editor h2 { margin-top: 2rem; }
.tool-editor h3 { margin-top: 1.5rem; }
.tool-editor ul { padding-left: 1.5rem; list-style: disc; margin-bottom: 1rem; }
.tool-editor p { margin-bottom: 1rem; color: var(--text-main); }

.tool-meta {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-surface);
    border-left: 4px solid var(--success);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
}

/* FAQ Accordion */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    background: var(--bg-surface);
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    text-align: left;
    padding: 1.25rem 1.5rem;
    background: none;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1.5rem;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
    padding-bottom: 1.25rem;
}

.accordion-icon {
    transition: transform 0.3s ease;
}
.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

/* Footer */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}
.footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}
.footer-links li {
    margin-bottom: 0.75rem;
}
.footer-links a {
    color: var(--text-muted);
}
.footer-links a:hover {
    color: var(--primary);
}
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: var(--primary);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--shadow-md);
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 992px) {
    .tool-layout {
        grid-template-columns: 1fr;
    }
    .tool-sidebar {
        position: static;
        height: auto;
    }
    .tool-main {
        min-height: auto;
    }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem;}
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--bg-surface);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition);
    }
    .nav-links.active {
        left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.5rem; }
}

@media (max-width: 576px) {
    .grid-4 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .tool-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
}
