/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --text-color: #f9fafb;
    --text-light: #d1d5db;
    --bg-color: #111827;
    --bg-secondary: #1f2937;
    --border-color: #374151;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
}

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

/* Header Styles */
header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

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

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-light);
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

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

/* Main Content */
main {
    padding: 2rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

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

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

/* Tools Grid */
.tools-grid {
    margin-bottom: 3rem;
}

.tools-grid h2 {
    font-size: 1.875rem;
    margin: 2rem 0 1rem 0;
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    display: block;
    box-shadow: var(--shadow);
}

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

.tool-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.tool-card p {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Tool Page Styles */
.tool-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 20px;
}

.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.tool-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

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

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

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

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

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

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.result-area {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    display: none;
}

.result-area.show {
    display: block;
}

.result-text {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}

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

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* FAQ Section */
.faq {
    margin: 3rem 0;
}

.faq h2 {
    font-size: 1.875rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-color);
}

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

.faq-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.faq-item p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.footer-section p,
.footer-section li {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

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

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

.footer-bottom p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tool-header h1 {
        font-size: 2rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .tool-content {
        padding: 1.5rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}

/* File Upload Styles */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: var(--bg-color);
}

.file-upload:hover,
.file-upload.drag-over {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.file-upload input[type="file"] {
    display: none;
}

.file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    display: none;
}

.file-info.show {
    display: block;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin: 1rem 0;
    display: none;
}

.progress-container.show {
    display: block;
}

.progress-bar {
    height: 6px;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    transition: width 0.3s ease;
    width: 0%;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    display: none;
}

.alert.show {
    display: block;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

/* Loading Spinner */
.spinner {
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

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

/* Copy Button Animation */
.copy-success {
    animation: copyFeedback 0.3s ease;
}

@keyframes copyFeedback {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Dark mode transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}