/* ============================================
   QUIZ STYLES - Cornis eLearning
   ============================================
   
   Structure:
   1. Basic Quiz Container
   2. Choice Items (Cards)
   3. Answer States (Correct/Incorrect/Missing)
   4. Submit Button
   5. Hints
   6. Image Quiz
   7. Drag & Drop Quiz
   
   Color scheme:
   - Orange (#FF8E00): Selected state, Cornis brand
   - Green (#1b9f47): Correct answers
   - Red (#FF0000): Incorrect answers
   - Orange warning (#FF9800): Missing answers
   - Blue (#2980B9): Hints and information
   
   ============================================ */

/* ============================================
   1. BASIC QUIZ CONTAINER
   ============================================ */
.quizz-content ul {
    padding-left: 0;
    list-style: none;
}

.quizz-content {
    margin: 2rem 0;
}

/* ============================================
   2. CHOICE ITEMS - Modern Card Style
   ============================================ */

/* Base card styling */
.choice-item {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Left accent bar (4px orange line) */
.choice-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: all 0.2s ease;
}

/* Hover effect - Orange accent appears */
.choice-item-selectable:hover {
    background-color: #f9fafb;
    border-color: #FF8E00;           /* Cornis orange */
    transform: translateX(4px);       /* Slight slide right */
    box-shadow: 0 4px 12px rgba(255, 142, 0, 0.1);
}

.choice-item-selectable:hover::before {
    background: #FF8E00;
}

/* Selected state - Orange background tint */
.choice-item-selected {
    background-color: #FFF8F0;       /* Light orange tint */
    border-color: #FF8E00;
    box-shadow: 0 4px 12px rgba(255, 142, 0, 0.15);
}

.choice-item-selected::before {
    background: #FF8E00;
}

/* ============================================
   3. ANSWER STATES
   ============================================ */

/* --- CORRECT ANSWER --- */

/* Scale up animation with green background */
@keyframes correct-answer {
    0% { 
        transform: scale(1);
        background-color: #FFF8F0;
    }
    50% { 
        transform: scale(1.02);          /* Slight grow */
    }
    100% { 
        background-color: #E8F5E9;       /* Green background */
        border-color: #1b9f47;           /* Green border */
    }
}

.answer-quizz .correct {
    animation: correct-answer 500ms ease forwards;
    position: relative;
}

.answer-quizz .correct::before {
    background: #1b9f47 !important;      /* Green accent bar */
}

/* Checkmark icon (✓) appears on right */
.answer-quizz .correct::after {
    content: '✓';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #1b9f47;
    font-size: 1.5rem;
    font-weight: bold;
    animation: check-appear 300ms ease 200ms forwards;
    opacity: 0;
}

/* Icon fade-in animation */
@keyframes check-appear {
    from { 
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
    to { 
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* --- INCORRECT ANSWER --- */

/* Shake animation with red background */
@keyframes incorrect-answer {
    0% { 
        transform: translateX(0);
        background-color: #FFF8F0;
    }
    20% { 
        transform: translateX(-8px);     /* Shake left */
    }
    40% { 
        transform: translateX(8px);      /* Shake right */
    }
    60% { 
        transform: translateX(-4px);     /* Small shake left */
    }
    80% { 
        transform: translateX(4px);      /* Small shake right */
    }
    100% { 
        transform: translateX(0);
        background-color: #FFEBEE;       /* Red background */
        border-color: #FF0000;           /* Red border */
    }
}

.answer-quizz .incorrect {
    animation: incorrect-answer 500ms ease forwards;
}

.answer-quizz .incorrect::before {
    background: #FF0000 !important;      /* Red accent bar */
}

/* Cross icon (✕) appears on right */
.answer-quizz .incorrect::after {
    content: '✕';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #FF0000;
    font-size: 1.5rem;
    font-weight: bold;
    animation: check-appear 300ms ease 200ms forwards;
    opacity: 0;
}

/* --- MISSING ANSWER --- */

/* Pulsing orange border (3 times) */
@keyframes missing-pulse {
    0%, 100% { 
        border-color: #FF9800;           /* Orange warning */
        background-color: #ffffff;
    }
    50% { 
        border-color: #ffbe00;           /* Brighter orange */
        background-color: #FFF8E1;       /* Light yellow tint */
    }
}

.answer-quizz .missing {
    animation: missing-pulse 400ms ease 3;  /* Repeat 3 times */
    border-width: 3px;                      /* Thicker border */
}

.answer-quizz .missing::before {
    background: #FF9800 !important;      /* Orange accent bar */
}

/* ============================================
   4. SUBMIT BUTTON
   ============================================ */
.submit-quizz {
    background: linear-gradient(135deg, #FF8E00 0%, #FFB84D 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 142, 0, 0.2);
    align-self: flex-start;
    margin-top: 1rem;
    margin-left: 1.5rem;          /* Align with choice cards */
}

/* Hover effect - Lift up slightly */
.submit-quizz:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 142, 0, 0.3);
    background: linear-gradient(135deg, #E67E00 0%, #FF9E1F 100%);
}

.submit-quizz:active {
    transform: translateY(0);            /* Press down on click */
}

/* ============================================
   5. HINTS
   ============================================ */

/* Hint reveal animation */
@keyframes hint-reveal {
    from { 
        opacity: 0;
        max-height: 0;
        margin-top: 0;
    }
    to { 
        opacity: 1;
        max-height: 100px;
        margin-top: 0.5rem;
    }
}

/* Hint box styling - Blue info color */
.quizz-hint {
    background: #E8F4FD;                 /* Light blue */
    border-left: 3px solid #2980B9;      /* Blue accent */
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-style: italic;
    font-size: 0.875rem;
    color: #1C5A85;
    animation: hint-reveal 300ms ease forwards;
    margin-left: 0.5rem;
}

/* ============================================
   6. IMAGE QUIZ
   ============================================ */

/* Grid layout for multiple images */
.image-choice-container {
    display: grid;
    grid-template-columns: repeat(3, auto);
    grid-auto-flow: row;
    gap: 1em;
    margin: 1em auto;
    justify-content: center;
}

.image-choice-container img {
    padding: 0.4rem;
    margin: 0;
}

/* ============================================
   7. DRAG & DROP QUIZ
   ============================================ */

.draggable-list {
    position: relative;
    display: flex;
    flex-direction: column;
}

.draggable-list ul {
    padding-left: 0;
    list-style: none;
}

/* Placeholder for drag target */
.placeholder {
    background-color: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

/* Draggable item styling - Match choice-item style */
.draggable-item {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    cursor: grab;
    user-select: none;
}

/* Drag handle icon */
.draggable-item::before {
    content: '☰';
    font-size: 1rem;
    color: #9ca3af;
    margin-right: 1rem;
}

/* Hover effect */
.draggable-item:hover {
    background-color: #f9fafb;
    border-color: #FF8E00;
}

.draggable-item:hover::before {
    color: #FF8E00;
}

/* Active dragging state */
.draggable-item:active {
    cursor: grabbing;
}

.dragging-item {
    opacity: 0.8;
    border-color: #FF8E00;
    background: #FFF8F0;
}

/* Content inside draggable item */
.draggable-list .content {
    display: inline;
    margin: 0;
    flex: 1;
}

/* Correct/incorrect states for drag items */
.draggable-list .correct {
    background-color: #E8F5E9;
    border-color: #1b9f47;
}

.draggable-list .incorrect {
    background-color: #FFEBEE;
    border-color: #FF0000;
}
