:root {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #475569;
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #10b981;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --input-bg: #f8fafc;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --border-radius: 12px;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --primary-color: #6366f1;
    --primary-hover: #818cf8;
    --secondary-color: #34d399;
    --card-bg: #1e293b;
    --border-color: #334155;
    --input-bg: #0f172a;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

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

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

/* Header & Navbar */
header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.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: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav ul li a {
    color: var(--text-color);
    font-weight: 500;
}

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

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

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

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 160px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-color) 100%);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* Typography elements for content pages */
.content-section {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.content-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.content-section h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.5rem;
}

.content-section p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

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

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

.tool-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.tool-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: #ffffff !important;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: scale(1.02);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-color) !important;
}

.btn-secondary:hover {
    background-color: var(--text-muted);
    color: #ffffff !important;
}

/* Form Elements */
.tool-container {
    max-width: 800px;
    margin: 0 auto;
}

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

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

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

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

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* Tool Results Section */
.results-section {
    margin-top: 2rem;
    display: none; /* Hidden by default */
}

.results-card {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.result-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--input-bg);
    transition: var(--transition);
}

.result-item:hover {
    border-color: var(--primary-color);
}

.result-text {
    flex-grow: 1;
    margin-right: 1rem;
}

.copy-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* Loader */
.loader-container {
    display: none;
    text-align: center;
    margin: 2rem 0;
}

.loader {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
}

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

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .copy-btn {
        align-self: flex-end;
    }
}
