:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    --accent-color: #667eea;
    --text-dark: #2c3e50;
    --text-light: #718096;
    --surface: #ffffff;
    --border-radius: 16px;
    --shadow-soft: 0 10px 40px rgba(0,0,0,0.08);
    --shadow-strong: 0 20px 60px rgba(0,0,0,0.15);
    --animation-duration: 0.3s;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: #f8f9fa;
    overflow-x: hidden;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 1rem 0;
    transition: all var(--animation-duration) ease;
}

.navbar__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar__logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.navbar__nav {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.navbar__link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--animation-duration) ease;
}

.navbar__link:hover {
    color: var(--accent-color);
}

.hero {
    background: var(--primary-gradient);
    padding: 100px 0 50px;
    color: white;
    text-align: center;
}

.hero__title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero__subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1rem;
}

.sidebar {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.main-content {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    max-width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

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

.color-input {
    height: 40px;
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.range-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-group input[type="range"] {
    flex: 1;
}

.range-value {
    min-width: 40px;
    font-weight: 600;
    color: #667eea;
}

/* Общие стили для предотвращения горизонтальной прокрутки */
.copy-btn {
    white-space: nowrap;
    min-width: auto;
}

.checkbox-group {
    flex-wrap: wrap;
}

pre {
    overflow-x: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 25px 0 15px 0;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.section-title:first-child {
    margin-top: 0;
}

.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-area {
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    min-height: 400px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.preview-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.preview-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.code-output {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.copy-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #38a169;
}

.copy-btn.copied {
    background: #38a169;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.responsive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .navbar__container {
        padding: 0 1rem;
    }
    
    .navbar__nav {
        gap: 1rem;
    }
    
    .navbar__link {
        font-size: 0.9rem;
    }
    
    .hero {
        padding: 80px 0 30px;
    }
    
    .hero__title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
    
    .hero__subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .responsive-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    .sidebar,
    .main-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .navbar__container {
        padding: 0 0.5rem;
    }
    
    .navbar__nav {
        display: none;
    }
    
    .hero {
        padding: 70px 0 20px;
    }
    
    .container {
        padding: 0.25rem;
    }
    
    .sidebar,
    .main-content {
        padding: 0.75rem;
    }
    
    .preview-area {
        padding: 20px;
        min-height: 300px;
    }
    
    .preview-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    /* Адаптация вкладок */
    .tabs {
        overflow-x: auto;
        padding-bottom: 3px;
        margin-bottom: 17px;
    }
    
    .tab {
        padding: 8px 12px;
        font-size: 12px;
        min-width: fit-content;
        flex-shrink: 0;
    }
    
    /* Адаптация кнопок и элементов управления */
    div[style*="display: flex"] {
        flex-wrap: wrap !important;
    }
    
    .copy-btn {
        font-size: 12px !important;
        padding: 8px 12px !important;
        min-width: auto !important;
        flex: 1 1 auto;
    }
    
    .checkbox-group {
        flex-wrap: wrap !important;
    }
    
    .checkbox-group label {
        font-size: 13px;
        flex: 1 1 auto;
        min-width: fit-content;
    }
    
    pre {
        font-size: 10px !important;
        overflow-x: auto;
        word-wrap: break-word;
    }
}

.advanced-option {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-bottom: 15px;
}

.option-help {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.preset-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.preset-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
}

.preset-card h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 16px;
}

.preset-card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.preset-features {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.preset-features span {
    font-size: 12px;
    color: #059669;
    font-weight: 500;
}

.preset-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.preset-card:hover::before {
    transform: scaleX(1);
}

.status-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    z-index: 10000;
    transform: translateY(100px);
    transition: all 0.3s ease;
}

.status-indicator.show {
    transform: translateY(0);
}

.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.export-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.export-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.export-card h5 {
    margin-bottom: 10px;
    color: #495057;
}

.export-card p {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
}

/* Quiz Styles */
.quiz-question-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all var(--animation-duration) ease;
}

.quiz-question-item:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-soft);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.question-header strong {
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 600;
}

.remove-question {
    background: #dc3545;
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.remove-question:hover {
    background: #c82333;
    transform: scale(1.05);
}

.question-options-container {
    margin-top: 15px;
}

.question-options {
    margin-bottom: 15px;
}

.option-item {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.option-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.option-item input {
    flex: 1;
    border: none;
    padding: 8px;
    border-radius: 4px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.option-item input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.option-item button {
    background: #dc3545;
    border: none;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.option-item button:hover {
    background: #c82333;
    transform: scale(1.05);
}

.add-option {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.add-option:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.scale-settings,
.text-settings {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.scale-settings label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.scale-settings input {
    width: 100%;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.scale-settings input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.preset-card.special {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.preset-card.special::before {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
    height: 100%;
    transform: scaleX(1);
    opacity: 0.1;
}

.preset-card.special h4 {
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.preset-card.special p {
    color: rgba(255,255,255,0.9);
}

.preset-card.special .preset-features span {
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
}

.preset-card.special:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}