* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    margin: 0;
    padding: 20px;
    background: #f8f9fa;
    color: #2c3e50;
}

.header-bar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.utility-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.utility-btn {
    padding: 8px 16px;
    border: 2px solid #4a90e2;
    border-radius: 20px;
    background: white;
    color: #4a90e2;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.utility-btn:hover {
    background: #4a90e2;
    color: white;
    transform: translateY(-1px);
}

.page-title {
    color: #2c3e50;
    font-size: 22px;
    font-weight: 600;
    margin: 8px 0 14px 0;
}

.special-chars {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.char-label {
    font-size: 13px;
    color: #7f8c8d;
}

.char-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d8dee5;
    border-radius: 6px;
    background: #f8f9fa;
    color: #2c3e50;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s;
}

.char-btn:hover {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

.char-btn.copied {
    background: #2ecc71;
    color: white;
    border-color: #2ecc71;
}

.main-container {
    max-width: 800px;
    margin: 0 auto;
}

.exercise-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.exercise-card h2 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    padding-left: 12px;
    border-left: 4px solid #4a90e2;
}

.exercise-controls {
    margin-bottom: 16px;
}

select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #d8dee5;
    border-radius: 10px;
    background: white;
    color: #2c3e50;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237f8c8d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

select:focus {
    border-color: #4a90e2;
}

.question-display {
    min-height: 40px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 16px;
    white-space: pre-wrap;
}

.answer-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.answer-row input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 2px solid #d8dee5;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.answer-row input[type="text"]:focus {
    border-color: #4a90e2;
}

.primary-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background: #4a90e2;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.primary-btn:hover {
    background: #357abd;
    transform: translateY(-1px);
}

.secondary-btn {
    padding: 10px 20px;
    border: 2px solid #4a90e2;
    border-radius: 10px;
    background: white;
    color: #4a90e2;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.secondary-btn:hover {
    background: #4a90e2;
    color: white;
    transform: translateY(-1px);
}

.feedback {
    margin-top: 14px;
    font-size: 15px;
    min-height: 20px;
}

/* Dark Mode */
[data-theme="dark"] body {
    background: #1a1a2e;
    color: #e0e0e0;
}

[data-theme="dark"] .header-bar,
[data-theme="dark"] .exercise-card {
    background: #16213e;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

[data-theme="dark"] .page-title,
[data-theme="dark"] .exercise-card h2 {
    color: #e8e8e8;
}

[data-theme="dark"] .utility-btn {
    background: #1a1a2e;
    border-color: #3a6db5;
    color: #6cb4e8;
}

[data-theme="dark"] .utility-btn:hover {
    background: #3a6db5;
    color: #fff;
}

[data-theme="dark"] .char-btn {
    background: #1a1a2e;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .char-btn:hover {
    background: #3a6db5;
    border-color: #3a6db5;
}

[data-theme="dark"] .char-label {
    color: #888;
}

[data-theme="dark"] select {
    background-color: #1a1a2e;
    border-color: #444;
    color: #e0e0e0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

[data-theme="dark"] select:focus {
    border-color: #3a6db5;
}

[data-theme="dark"] .question-display {
    background: #1a1a2e;
    color: #e0e0e0;
}

[data-theme="dark"] .answer-row input[type="text"] {
    background: #1a1a2e;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .answer-row input[type="text"]:focus {
    border-color: #3a6db5;
}

[data-theme="dark"] .primary-btn {
    background: #3a6db5;
}

[data-theme="dark"] .secondary-btn {
    background: #1a1a2e;
    border-color: #3a6db5;
    color: #6cb4e8;
}

[data-theme="dark"] .secondary-btn:hover {
    background: #3a6db5;
    color: #fff;
}

@media (max-width: 600px) {
    body { padding: 12px; }
    .answer-row { flex-direction: column; }
    .answer-row input[type="text"] { min-width: 100%; }
}
