* {
    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;
    color: #333;
}

.container-main {
    max-width: 900px;
    margin: 0 auto;
    animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Header */
.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: slideDownFade 0.8s ease-out;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header h1 {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: -1px;
}

.pro-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 5px 15px;
    border-radius: 25px;
    font-size: 0.6em;
    font-weight: 700;
    display: inline-block;
    margin-left: 15px;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.header p {
    font-size: 1.1em;
    opacity: 0.95;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
    animation: slideUpFade 0.8s ease-out 0.1s both;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mode-btn {
    background: white;
    border: 2px solid transparent;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Messages */
.success-message,
.error-message {
    display: none;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    animation: slideDownMessage 0.3s ease-out;
}

@keyframes slideDownMessage {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message {
    background: #4caf50;
    color: white;
    border-left: 4px solid #2e7d32;
}

.error-message {
    background: #f44336;
    color: white;
    border-left: 4px solid #c62828;
}

/* Mode Section */
.mode-section {
    display: none;
    animation: fadeInScale 0.5s ease-out;
}

.mode-section.active {
    display: block;
}

/* Quiz Creator */
.quiz-creator {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    animation: scaleInUp 0.6s ease-out;
}

@keyframes scaleInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.input-group-custom {
    margin-bottom: 25px;
}

.input-group-custom label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.input-group-custom input,
.input-group-custom textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: vertical;
}

.input-group-custom input:focus,
.input-group-custom textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: scale(1.01);
}

.input-group-custom textarea {
    min-height: 80px;
}

/* Answers Grid */
.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.answer-input {
    position: relative;
}

.answer-input input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.answer-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.correct-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.hint-input textarea {
    min-height: 80px;
}

.btn-add-question {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-add-question:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-add-question:active {
    transform: translateY(0);
}

/* Questions List */
.questions-list {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
    animation: scaleInUp 0.6s ease-out 0.1s both;
}

.questions-counter {
    font-size: 1.1em;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.questions-counter i {
    margin-right: 8px;
}

#questionsList {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.question-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    animation: slideInLeft 0.4s ease-out backwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question-item:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

.question-text {
    font-size: 1.05em;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.hint-display {
    background: #fff3e0;
    border-left: 3px solid #ff9800;
    padding: 12px 15px;
    border-radius: 4px;
    color: #e65100;
    font-size: 0.9em;
    margin: 12px 0;
}

.question-actions {
    display: flex;
    gap: 10px;
}

.btn-edit,
.btn-delete {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-edit {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-edit:hover {
    background: #bbdefb;
    transform: translateY(-2px);
}

.btn-delete {
    background: #ffebee;
    color: #c62828;
}

.btn-delete:hover {
    background: #ffcdd2;
    transform: translateY(-2px);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state i {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1em;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    animation: slideUpFade 0.6s ease-out;
}

.btn-action {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn-start-quiz {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-start-quiz:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-export-csv {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-export-csv:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.btn-clear {
    background: #ffebee;
    color: #c62828;
}

.btn-clear:hover {
    background: #ffcdd2;
    transform: translateY(-3px);
}

/* Quiz Section */
.quiz-section {
    animation: fadeInScale 0.5s ease-out;
}

.shuffle-info {
    background: #e3f2fd;
    color: #1976d2;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #1976d2;
    font-weight: 600;
    animation: slideDownMessage 0.3s ease-out;
}

.controls {
    margin-bottom: 25px;
}

.progress-info {
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    color: white;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-control {
    padding: 12px 25px;
    background: white;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: #f0f0f0;
}

.btn-control:active {
    transform: translateY(0);
}

/* Quiz Container */
.quiz-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    margin: 30px 0;
    animation: scaleInUp 0.6s ease-out;
}

.question-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.5;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.answers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.answer-option {
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f1ff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    text-align: left;
    animation: scaleInAnswer 0.4s ease-out backwards;
}

@keyframes scaleInAnswer {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.answer-option:nth-child(1) {
    animation-delay: 0s;
}

.answer-option:nth-child(2) {
    animation-delay: 0.1s;
}

.answer-option:nth-child(3) {
    animation-delay: 0.2s;
}

.answer-option:nth-child(4) {
    animation-delay: 0.3s;
}

.answer-option:hover:not(:disabled) {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #e0e7ff 0%, #f0f1ff 100%);
}

.answer-option:disabled {
    cursor: not-allowed;
}

/* Import Section */
.import-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    animation: fadeInScale 0.5s ease-out;
}

.import-box {
    background: white;
    padding: 40px;
    border: 3px dashed #667eea;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.import-box:hover {
    border-color: #764ba2;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.import-box i {
    font-size: 3em;
    color: #667eea;
    margin-bottom: 15px;
}

.btn-upload {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.file-input {
    display: none;
}

.file-name {
    margin-top: 15px;
    color: #4caf50;
    font-weight: 600;
}

/* Info Section */
.info-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    animation: scaleInUp 0.6s ease-out 0.1s both;
}

.info-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.format-example {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    color: #333;
    line-height: 1.8;
    border-left: 4px solid #667eea;
    overflow-x: auto;
}

.info-section ul {
    margin-left: 20px;
    line-height: 1.8;
}

.info-section li {
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .container-main {
        padding: 10px;
    }

    .header h1 {
        font-size: 2em;
    }

    .mode-selector {
        flex-direction: column;
    }

    .quiz-creator,
    .questions-list {
        padding: 20px;
    }

    .answers-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
    }

    .quiz-container {
        padding: 20px;
    }

    .question-title {
        font-size: 1.2em;
        margin-bottom: 20px;
    }

    .answers-container {
        grid-template-columns: 1fr;
    }

    .question-item {
        flex-direction: column;
    }

    .question-actions {
        width: 100%;
        margin-top: 15px;
    }

    .btn-edit,
    .btn-delete {
        flex: 1;
    }

    .control-buttons {
        gap: 8px;
    }

    .btn-control {
        padding: 10px 15px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }

    .pro-badge {
        font-size: 0.5em;
        padding: 3px 10px;
        margin-left: 8px;
    }

    .mode-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .quiz-creator,
    .questions-list,
    .import-box {
        padding: 15px;
    }

    .quiz-container {
        padding: 15px;
    }

    .control-buttons {
        flex-direction: column;
    }

    .btn-control {
        width: 100%;
        padding: 12px;
    }

    .question-title {
        font-size: 1.1em;
    }

    .answers-container {
        gap: 10px;
    }

    .answer-option {
        padding: 15px;
        font-size: 0.9em;
    }
}