:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #7209b7;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.8);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #4cc9f0;
    --secondary-color: #4895ef;
    --accent-color: #560bad;
    --text-color: #f8f9fa;
    --bg-color: #121212;
    --card-bg: rgba(33, 33, 33, 0.8);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--secondary-color);
}

h3 {
    font-size: 1.2rem;
    margin: 1rem 0;
    color: var(--accent-color);
}

.theme-toggle {
    display: flex;
    align-items: center;
}

#themeToggle {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

#themeToggle:hover {
    opacity: 0.9;
}

.hero {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.tool-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.input-area {
    margin-bottom: 1.5rem;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    background: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
}

.char-count {
    text-align: right;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    background: var(--bg-color);
    color: var(--text-color);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-group input {
    margin-right: 0.5rem;
}

.actions {
    display: flex;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-primary:hover, .btn-secondary:hover {
    opacity: 0.9;
}

.results-section {
    margin: 2rem 0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.result-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.result-text {
    flex-grow: 1;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

.result-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.result-btn:hover {
    opacity: 0.9;
}

.features-section, .why-section, .best-section, .blog-section, .faq-section {
    margin: 3rem 0;
}

.features-grid, .blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card, .blog-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.faq-list {
    margin-top: 1.5rem;
}

.faq-item {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.faq-item h3 {
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: white;
    margin: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item h3::after {
    content: '+';
    font-size: 1.5rem;
}

.faq-item.active h3::after {
    content: '-';
}

.faq-item p {
    padding: 1rem 1.5rem;
    margin: 0;
}

footer {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-note {
    margin: 1rem 0;
    font-style: italic;
}

#cancelButton {
    margin-top: 1rem;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    border-radius: var(--border-radius);
    z-index: 1000;
    box-shadow: var(--shadow);
    max-width: 300px;
    display: none;
}

.notification.error {
    background: #ff4757;
    color: white;
}

.notification.success {
    background: #2ed573;
    color: white;
}

@media (max-width: 768px) {
    .controls {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .theme-toggle {
        margin-top: 1rem;
    }
}

@media print {
    .tool-section, .actions, .result-actions, .theme-toggle, footer {
        display: none;
    }
    
    .results-section {
        display: block !important;
    }
    
    .result-card {
        break-inside: avoid;
    }
}