:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #f59e0b;
    --secondary-hover: #d97706;
    --success: #10b981;
    --danger: #ef4444;
    --dark: #1f2937;
    --light: #f3f4f6;
    --gray: #9ca3af;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f9fafb;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

header p {
    font-size: 1.1rem;
    color: var(--gray);
}

.tab-container {
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    margin: 0 5px;
    border-radius: 6px 6px 0 0;
}

.tab-btn.active {
    background-color: var(--primary);
    color: white;
}

.tab-content {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 0 6px 6px 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

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

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    transition: border 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

button, .btn {
    padding: 12px 24px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover, .btn:hover {
    background-color: var(--primary-hover);
}

button.secondary, .btn.secondary {
    background-color: var(--secondary);
}

button.secondary:hover, .btn.secondary:hover {
    background-color: var(--secondary-hover);
}

.questions-container {
    margin-top: 30px;
}

.question-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.question-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
}

.edit-btn, .delete-btn {
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.edit-btn {
    background-color: var(--secondary);
    color: white;
}

.delete-btn {
    background-color: var(--danger);
    color: white;
}

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

.option-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.option-input {
    flex: 1;
    margin-right: 10px;
}

.correct-checkbox {
    margin-right: 5px;
}

.option-actions {
    margin-left: 10px;
}

.add-option-btn, .remove-option-btn {
    padding: 5px 10px;
    font-size: 0.9rem;
}

.add-option-btn {
    background-color: var(--success);
    color: white;
}

.remove-option-btn {
    background-color: var(--danger);
    color: white;
}

/* Quiz Playing Styles */
#quiz-container {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.timer {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark);
    background: var(--light);
    padding: 8px 16px;
    border-radius: 20px;
}

.progress-container {
    width: 100%;
    height: 8px;
    background-color: var(--light);
    border-radius: 4px;
    margin-bottom: 30px;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.question {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.option {
    background-color: var(--light);
    padding: 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option:hover {
    background-color: #e5e7eb;
}

.option.selected {
    background-color: var(--primary);
    color: white;
}

.option.correct {
    background-color: var(--success);
    color: white;
}

.option.incorrect {
    background-color: var(--danger);
    color: white;
}

.quiz-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Results Page */
.results-container {
    text-align: center;
}

.score-display {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 20px 0;
    color: var(--primary);
}

.results-details {
    margin: 30px 0;
}

.share-container {
    margin: 30px 0;
}

.share-link {
    padding: 15px;
    background-color: var(--light);
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
}

.modal {
    background-color: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .question {
        font-size: 1.1rem;
    }
}