* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 8px;
}

.header p {
    font-size: 16px;
    margin: 0;
    margin-bottom: 20px;
}

.nav-link {
    position: relative;
    background: white;
    color: #667eea;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    margin: 0 8px;
    display: inline-block;
}

.nav-link:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.content {
    padding: 30px;
}

.instructions {
    background: #fff9e6;
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.instructions h3 {
    color: #b8860b;
    margin-bottom: 8px;
    font-size: 16px;
}

.instructions ol {
    margin-left: 20px;
}

.instructions li {
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.controls {
    padding: 0;
    background: transparent;
    border-bottom: none;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
}

.control-group input,
.control-group select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

button {
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
}

.btn-generate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-generate:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-convert {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-convert:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-copy {
    background: #28a745;
}

.btn-copy:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-clear {
    background: #6c757d;
}

.btn-clear:hover {
    background: #5a6268;
}

.quiz-container {
    padding: 15px;
}

.question-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
    gap: 8px;
}

.question-number {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    background: #f0f3ff;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.question-topic {
    font-size: 12px;
    color: #764ba2;
    background: #f8f0ff;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.question-text {
    font-size: 15px;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.5;
    flex: 1;
}

.answer-section {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.show-answer-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.show-answer-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.show-answer-checkbox label {
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    font-size: 13px;
}

.answer-content {
    margin-top: 8px;
    padding: 10px;
    background: #f0f9ff;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    display: none;
    font-size: 13px;
}

.answer-content.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.answer-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 12px;
}

.answer-text {
    color: #555;
    line-height: 1.4;
    font-size: 13px;
}

.info-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #c33;
}

.success-message {
    background: #efe;
    color: #3a3;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3a3;
}

.message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.stats {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    color: #004085;
    font-weight: 600;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.panel {
    display: flex;
    flex-direction: column;
}

.panel h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

textarea {
    width: 100%;
    min-height: 400px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

@media (max-width: 900px) {
    .converter-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
}
