:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #e2e8f0;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    -webkit-text-fill-color: unset;
}

/* Input Section */
.input-section {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.content-type-selector {
    margin-bottom: 25px;
}

.content-type-selector h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.type-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.type-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.type-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.type-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Content Input */
.content-input {
    margin-bottom: 20px;
}

.content-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

#content-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#content-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.char-count {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Tone Selector */
.tone-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

#tone-select {
    width: 100%;
    padding: 12px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
}

/* Output Section */
.output-section {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.output-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.output-formats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.format-card {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.format-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.format-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.format-card.selected {
    border-color: var(--primary-color);
}

.format-card.selected::before {
    opacity: 0.1;
}

.format-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.format-card h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    position: relative;
}

.format-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: relative;
}

/* Convert Button */
.convert-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.convert-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.convert-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.results-section {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    animation: slideIn 0.5s ease;
}

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

.result-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.result-tab {
    padding: 8px 16px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.result-content {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 200px;
    white-space: pre-wrap;
    font-family: 'Consolas', 'Monaco', monospace;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 10px 20px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Features Section */
.features-section {
    margin-top: 50px;
}

.features-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.feature {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.feature p {
    color: var(--text-secondary);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 50px;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .input-section,
    .output-section,
    .results-section {
        padding: 20px;
    }
    
    .type-buttons {
        justify-content: center;
    }
    
    .output-formats {
        grid-template-columns: 1fr 1fr;
    }
    
    .result-actions {
        flex-wrap: wrap;
    }
}