:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --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);
    --radius: 12px;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Header */
.sticky-header {
    background-color: var(--card-bg);
    opacity: 0.95;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: #ff0000;
    font-size: 1.5rem;
}

nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

#theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#theme-toggle:hover {
    background: var(--bg-color);
}

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

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

/* Hero Section */
.hero {
    padding: 60px 0;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -0.025em;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Tool Card */
.tool-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    gap: 10px;
}

input[type="text"] {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
    font-size: 1rem;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

/* Result Area */
#resultArea {
    margin-top: 40px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    text-align: center;
}

.preview-card img {
    width: 100%;
    max-width: 640px;
    border-radius: 8px;
    height: auto;
    margin-bottom: 15px;
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-main);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.download-option {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.download-option h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.download-option p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 15px;
}

.btn-download {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background 0.2s;
}

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

/* Content Section */
.content-section {
    padding: 60px 0;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.text-content h2 {
    margin: 30px 0 15px;
    font-size: 1.75rem;
    color: var(--text-main);
}

.text-content p {
    margin-bottom: 15px;
    color: var(--text-muted);
}

.steps {
    margin: 20px 0;
    padding-left: 20px;
}

.steps li {
    margin-bottom: 10px;
}

.features-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.features-list i {
    color: #10b981;
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.faq-item h3 {
    font-size: 1.125rem;
    margin-bottom: 10px;
}

/* Footer */
footer {
    padding: 40px 0;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

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

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

/* Page Content (Extra Pages) */
.page-content {
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.page-content h1 {
    margin-bottom: 30px;
    text-align: left;
}

.page-content h2 {
    margin: 40px 0 15px;
    font-size: 1.5rem;
    color: var(--text-main);
}

.page-content p {
    margin-bottom: 20px;
    color: var(--text-muted);
}

.page-content ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.page-content li {
    margin-bottom: 10px;
}

/* Loading */
.hidden { display: none !important; }

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .input-group { flex-direction: column; }
    .faq-grid { grid-template-columns: 1fr; }
    .footer-grid { flex-direction: column; text-align: center; }
}
