:root {
    --primary-color: #7558F7;
    --primary-dark: #5438C7;
    --secondary-color: #1E1E1E;
    --light-color: #F5F5F7;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    background-color: #fafafa;
    color: var(--secondary-color);
    line-height: 1.6;
}

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

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

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

header p {
    color: #666;
    font-size: 1.1rem;
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
}

.input-section, .output-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

h2 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-size: 1.3rem;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    resize: vertical;
    font-size: 1rem;
    margin-bottom: 1rem;
}

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

.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

button {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#generate-btn {
    background-color: var(--primary-color);
    color: white;
    flex: 1;
}

#generate-btn:hover {
    background-color: var(--primary-dark);
}

#clear-btn, #copy-btn {
    background-color: #f0f0f0;
    color: #333;
}

#clear-btn:hover, #copy-btn:hover {
    background-color: #e0e0e0;
}

.result {
    min-height: 200px;
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    padding: 1rem;
    white-space: pre-wrap;
    line-height: 1.6;
    overflow-x: auto;
}

.result code {
    font-family: 'Courier New', monospace;
}

.result pre {
    background-color: #1e1e1e;
    color: #f0f0f0;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1rem 0;
}

.terminal-buttons {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.terminal-button, .copy-command-button {
    background-color: #2E2E2E;
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.terminal-button:hover, .copy-command-button:hover {
    background-color: #444;
}

.terminal-button::before {
    content: '>';
    font-weight: bold;
    display: inline-block;
    margin-right: 0.25rem;
}

.copy-command-button::before {
    content: '📋';
    display: inline-block;
}

.copy-command-button.copied::before {
    content: '✓';
    color: #4CAF50;
}

footer {
    text-align: center;
    margin-top: 2rem;
    color: #777;
    font-size: 0.9rem;
}

.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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

#loading {
    text-align: center;
    margin: 2rem 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #333;
}

.api-form {
    margin-top: 1rem;
}

.input-group {
    display: flex;
    margin: 1.5rem 0;
    position: relative;
    align-items: center;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    margin-right: 1rem;
    min-width: 120px;
}

.input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.toggle-visibility {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 0.5rem;
    padding: 0.5rem;
}

.api-status {
    margin: 1rem 0;
    font-size: 0.9rem;
}

.api-status.valid {
    color: #4CAF50;
}

.api-status.invalid {
    color: #F44336;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.modal-buttons button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#save-api-key {
    background-color: var(--primary-color);
    color: white;
}

#save-api-key:hover {
    background-color: var(--primary-dark);
}

#clear-api-key {
    background-color: #f0f0f0;
    color: #333;
}

#clear-api-key:hover {
    background-color: #e0e0e0;
}

.api-help {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.api-help h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.api-help ol {
    padding-left: 1.5rem;
}

.api-help li {
    margin-bottom: 0.5rem;
}