:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --bg-dark: #0f0f1e;
    --bg-darker: #0a0a14;
    --text-light: #ffffff;
    --text-muted: #a0a0b0;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.5);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
    color: var(--text-light);
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* Header */
.header {
    padding: 2rem 0;
    text-align: center;
    background: rgba(15, 15, 30, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.logo svg {
    stroke: var(--primary);
}

.tagline {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 3rem 0;
}

/* Controls Panel */
.controls-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 150px;
}

.control-group-small {
    max-width: 120px;
}

.control-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-select,
.control-input {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: inherit;
}

.control-select:hover,
.control-input:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.control-select:focus,
.control-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.control-checkbox {
    justify-content: center;
}

.control-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-light);
}

.control-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Preview Container */
.preview-container {
    margin: 2rem 0;
    padding: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    transition: var(--transition);
}

.code-window {
    background: #282a36;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 680px;
    max-width: 100%;
    transition: var(--transition);
}

.code-window.no-shadow {
    box-shadow: none;
}

.window-controls {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px 10px 0 0;
}

.control-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: transform 0.2s;
}

.control-dot:hover {
    transform: scale(1.2);
}

.control-dot.red {
    background: #ff5f56;
}

.control-dot.yellow {
    background: #ffbd2e;
}

.control-dot.green {
    background: #27c93f;
}

.code-editor-wrapper {
    position: relative;
    padding: 1.5rem;
}

#codeEditor {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    background: transparent;
    border: none;
    color: #f8f8f2;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    position: relative;
    z-index: 2;
    tab-size: 4;
    caret-color: #f8f8f2;
}

#codeEditor::selection {
    background: rgba(102, 126, 234, 0.3);
}

#codePreview {
    margin: 0;
    padding: 1rem;
    background: transparent;
    border: none;
    min-height: 300px;
    pointer-events: none;
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    z-index: 1;
    opacity: 0;
}

#codeEditor:not(:focus) {
    opacity: 0;
}

#codeEditor:not(:focus)+#codePreview {
    opacity: 1;
}

#codePreview code {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.author-tag {
    padding: 0.75rem 1.5rem;
    text-align: right;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: rgba(248, 248, 242, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Author Input */
.author-input-section {
    margin: 2rem 0;
}

#authorInput {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
    font-family: 'Fira Code', monospace;
    transition: var(--transition);
}

#authorInput:hover {
    background: rgba(255, 255, 255, 0.05);
}

#authorInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    position: relative;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-light);
    transform: rotate(90deg);
}

.modal-content h2 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.modal-content>p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.result-section {
    margin-bottom: 1.5rem;
}

.result-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-field {
    display: flex;
    gap: 0.5rem;
}

.copy-field input,
.copy-field textarea {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-light);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    resize: none;
}

.btn-copy {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--primary-dark);
}

.btn-copy.copied {
    background: #27c93f;
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .controls-panel {
        flex-direction: column;
    }

    .control-group {
        min-width: 100%;
    }

    .control-group-small {
        max-width: 100%;
    }

    .preview-container {
        padding: 1.5rem;
    }

    .code-window {
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}