* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

:root {
    --primary-color: #7C3AED;
    --primary-hover: #6D28D9;
    --bg-color: #F9FAFB;
    --surface-color: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="default"] {
    --primary-color: #7C3AED;
    --primary-hover: #6D28D9;
    --bg-color: #F9FAFB;
    --surface-color: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="cyber"] {
    --primary-color: #00FF9C;
    --primary-hover: #00CC7D;
    --bg-color: #0D1117;
    --surface-color: #161B22;
    --text-primary: #00FF9C;
    --text-secondary: #4D9B7D;
    --border-color: #30363D;
    --shadow-color: rgba(0, 255, 156, 0.2);
}

:root[data-theme="retro"] {
    --primary-color: #FF6B6B;
    --primary-hover: #EE5253;
    --bg-color: #FAF3E0;
    --surface-color: #FFF8E7;
    --text-primary: #2F3542;
    --text-secondary: #747D8C;
    --border-color: #DFD3C3;
    --shadow-color: rgba(255, 107, 107, 0.2);
}

:root[data-theme="neon"] {
    --primary-color: #FF00FF;
    --primary-hover: #CC00CC;
    --bg-color: #000000;
    --surface-color: #1A1A1A;
    --text-primary: #FFFFFF;
    --text-secondary: #00FFFF;
    --border-color: #333333;
    --shadow-color: rgba(255, 0, 255, 0.3);
}

:root[data-theme="minimal"] {
    --primary-color: #000000;
    --primary-hover: #333333;
    --bg-color: #FFFFFF;
    --surface-color: #FAFAFA;
    --text-primary: #000000;
    --text-secondary: #666666;
    --border-color: #EEEEEE;
    --shadow-color: rgba(0, 0, 0, 0.05);
}

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

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

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

header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.input-section, .output-section {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
}

.theme-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    z-index: 1000;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.theme-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.theme-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding-bottom: 2px;
}

.theme-options::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.theme-btn {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.theme-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

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

.model-selection h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.radio-label:hover {
    background-color: #F3F4F6;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 0.5rem;
    position: relative;
    transition: border-color 0.3s ease;
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.label-text {
    font-size: 1rem;
    color: var(--text-primary);
}

button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.output-box {
    background: #F9FAFB;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    min-height: 150px;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
}

footer {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 3rem;
}

.example-prompts {
    margin-bottom: 2rem;
}

.example-prompts h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

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

.example-card {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.example-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px var(--shadow-color);
}

.example-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.example-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.use-example {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    background: var(--bg-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.use-example:hover {
    background: var(--primary-color);
    color: white;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .radio-group {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
}
