/* 
 * Kombinierte Frontend-CSS für das Literarische Tagesrätsel
 * Version 1.1
 */

/* ==========================================================================
   QUIZ GRUNDSTIL
   ========================================================================== */

.lit-quiz-container {
    max-width: 320px;
    margin: 0 auto;
    border: 1px solid #950000;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    font-family: 'PT Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    width: 100%;
}

/* Responsive Anpassungen */
@media screen and (min-width: 360px) {
    .lit-quiz-container {
        font-size: 15px;
    }
}

@media screen and (min-width: 480px) {
    .lit-quiz-container {
        max-width: 360px;
        font-size: 16px;
    }
}

/* ==========================================================================
   KONFETTI-CONTAINER
   ========================================================================== */

#lit-confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.lit-confetti {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 0;
}

/* ==========================================================================
   HEADER-BEREICH
   ========================================================================== */

.lit-quiz-header {
    background: linear-gradient(135deg, #950000 0%, #aa0000 100%);
    color: white;
    padding: 6px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.lit-header-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpath fill='%23ffffff' d='M30,20 L70,20 L50,90 Z'/%3E%3Cpath fill='%23ffffff' d='M30,80 L70,80 L50,10 Z'/%3E%3Ccircle fill='%23ffffff' cx='20' cy='50' r='15'/%3E%3Ccircle fill='%23ffffff' cx='80' cy='50' r='15'/%3E%3C/svg%3E");
    background-size: 50px 50px;
}

/* Glanz-Effekt */
.lit-quiz-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255,255,255,0.3) 30%, 
        rgba(255,255,255,0.5) 50%, 
        rgba(255,255,255,0.3) 70%, 
        transparent
    );
    animation: lit-shine-across 8s ease-in-out infinite;
    animation-delay: 3s;
    pointer-events: none;
    z-index: 1;
}

@keyframes lit-shine-across {
    0% { 
        left: -100%; 
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    35% {
        opacity: 1;
    }
    40% { 
        left: 100%; 
        opacity: 0;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

.lit-header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    position: relative;
    z-index: 2;
}

.lit-quiz-header h3 {
    margin: 0;
    font-size: 18px;
    font-family: 'Merriweather', Georgia, serif;
    position: relative;
    z-index: 2;
}

.lit-header-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.lit-header-icon svg {
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    width: 100%;
    height: 100%;
}

.lit-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 0;
    font-size: 12px;
    position: relative;
    z-index: 2;
}

.lit-stat-box {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 3px;
}

/* ==========================================================================
   QUIZ-KÖRPER
   ========================================================================== */

.lit-quiz-body {
    padding: 10px;
    background: white;
}

.lit-quiz-body p {
    line-height: 1.4 !important;
    margin-bottom: 8px !important;
}

.lit-question {
    font-size: 0.95rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

@media screen and (min-width: 480px) {
    .lit-question {
        font-size: 1rem;
    }
}

/* ==========================================================================
   ANTWORTOPTIONEN
   ========================================================================== */

.lit-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.lit-option {
    background: #f0f0f0;
    border: none;
    padding: 8px 10px;
    text-align: left;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: background-color 0.2s ease;
}

@media screen and (min-width: 480px) {
    .lit-option {
        padding: 8px 12px;
        font-size: 0.95rem;
    }
}

/* Touch-Optimierung */
@media (hover: hover) {
    .lit-option:hover {
        background: #e5e5e5;
    }
}

.lit-option:active {
    background: #d9d9d9;
}

.lit-option.selected {
    background: #950000;
    color: white;
    font-weight: bold;
}

.lit-option.correct {
    background: #4CAF50;
    color: white;
    font-weight: bold;
}

.lit-option.incorrect {
    background: #F44336;
    color: white;
    font-weight: bold;
}

/* ==========================================================================
   HINWEIS-BEREICH
   ========================================================================== */

.lit-hint-btn {
    color: #950000;
    background: none;
    border: none;
    padding: 4px 0;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    line-height: 1.3;
    transition: opacity 0.2s ease;
}

.lit-hint-btn:hover {
    opacity: 0.8;
}

.lit-hint-btn svg {
    margin-right: 6px;
    width: 10px;
    height: 10px;
}

.lit-hint-box {
    background: #f5f5f5;
    border-left: 2px solid #950000;
    padding: 8px 10px;
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 12px;
    line-height: 1.4;
    border-radius: 0 4px 4px 0;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.lit-check-btn {
    background: #950000;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    display: block;
    margin: 0 auto;
    transition: background-color 0.2s ease;
}

.lit-check-btn:hover {
    background: #aa0000;
}

.lit-check-btn:active {
    background: #7e0000;
}

.lit-check-btn:disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

.lit-check-btn.processing {
    background: #cccccc;
    color: #666666;
    cursor: wait;
    opacity: 0.7;
}

.lit-share-btn {
    background: #950000;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: background-color 0.2s ease;
}

.lit-share-btn:hover {
    background: #aa0000;
}

.lit-share-btn:active {
    background: #7e0000;
}

/* ==========================================================================
   ERGEBNIS-BEREICH
   ========================================================================== */

.lit-result-box {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 12px;
    margin-top: 14px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.lit-result-box * {
    line-height: 1.4 !important;
    margin-bottom: 6px !important;
}

.lit-result-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 8px !important;
}

.lit-correct-answer {
    margin-bottom: 8px !important;
}

.lit-explanation {
    margin-bottom: 8px !important;
    line-height: 1.4 !important;
}

/* ==========================================================================
   STATISTIK-BEREICH
   ========================================================================== */

.lit-percentage-container {
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
}

.lit-percentage-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-top: 4px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.lit-percentage-fill {
    height: 100%;
    background: #4CAF50;
    width: 0;
    transition: width 1s ease-in-out;
}

.lit-stats-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #666;
    margin-top: 2px;
    line-height: 1.3;
}

.lit-stats-result {
    font-size: 0.8rem;
    margin-top: 6px;
    color: #555;
    line-height: 1.3;
}

.lit-report-error {
    text-align: right;
    font-size: 0.75rem;
    margin-top: 10px;
}

.lit-report-link {
    color: #950000;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s ease;
}

.lit-report-link svg {
    margin-right: 4px;
}

.lit-report-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.lit-quiz-footer {
    background: #f5f5f5;
    border-top: 1px solid #ddd;
    padding: 6px;
    text-align: center;
    font-size: 0.7rem;
    color: #666;
    line-height: 1.3;
}

.lit-points-info {
    padding: 3px 0 5px 0;
    font-size: 0.7rem;
    color: #777;
    border-bottom: 1px dotted #ddd;
    margin-bottom: 4px;
    line-height: 1.3;
}

/* ==========================================================================
   TOUCH-OPTIMIERUNGEN
   ========================================================================== */

@media (pointer: coarse) {
    .lit-option {
        padding: 10px 12px;
        min-height: 44px;
    }
    
    .lit-check-btn, .lit-share-btn {
        min-height: 44px;
        padding: 10px 16px;
    }
    
    .lit-hint-btn {
        padding: 6px 0;
        min-height: 34px;
    }
}

/* ==========================================================================
   ACCESSIBILITY & MOTION
   ========================================================================== */

.lit-quiz-container button:focus,
.lit-quiz-container a:focus {
    outline: 2px solid #950000;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .lit-percentage-fill {
        transition: none;
    }
    
    .lit-confetti {
        display: none;
    }
    
    .lit-quiz-header::after {
        animation: none;
        display: none;
    }
}

/* ==========================================================================
   FLEXIBILITÄTS-KLASSEN
   ========================================================================== */

.lit-quiz-container.lit-width-small {
    max-width: 280px;
}

.lit-quiz-container.lit-width-medium {
    max-width: 360px;
}

.lit-quiz-container.lit-width-large {
    max-width: 480px;
}

.lit-quiz-container.lit-width-full {
    max-width: 100%;
}

/* ==========================================================================
   RESPONSIVE ANPASSUNGEN
   ========================================================================== */

@media screen and (max-width: 480px) {
    .lit-quiz-container {
        font-size: 15px;
    }
    
    .lit-option {
        line-height: 1.5;
    }
    
    .lit-result-box {
        font-size: 14px;
    }
}

@media screen and (max-width: 320px) {
    .lit-quiz-container {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
}

/* ==========================================================================
   SKELETON LOADING STYLES
   ========================================================================== */

.lit-quiz-skeleton .lit-quiz-loading {
    padding: 10px;
    background: white;
}

.lit-skeleton-line {
    position: relative;
}

.lit-loading-text {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: #333;
    font-size: 14px;
    font-weight: bold;
    opacity: 0.9;
    animation: lit-loading-pulse 1.5s ease-in-out infinite;
    z-index: 2;
    white-space: nowrap;
    pointer-events: none;
}

@keyframes lit-loading-pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.lit-skeleton {
    position: relative;
    overflow: hidden;
}

.lit-skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: lit-skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.lit-skeleton-line-short {
    width: 60%;
}

.lit-skeleton-line-medium {
    width: 80%;
}

.lit-skeleton-line-long {
    width: 95%;
}

.lit-skeleton .lit-option {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: lit-skeleton-shimmer 1.5s infinite;
    border: none;
    cursor: default;
    min-height: 40px;
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.lit-skeleton .lit-option:hover {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

.lit-skeleton-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.lit-skeleton-button {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: lit-skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
    height: 32px;
}

.lit-skeleton-button-small {
    width: 80px;
}

.lit-skeleton-button-large {
    width: 120px;
}

@keyframes lit-skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ==========================================================================
   ERROR STATES
   ========================================================================== */

.lit-quiz-error {
    padding: 20px;
    text-align: center;
    background: white;
}

.lit-error-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.lit-error-message {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

.lit-retry-btn {
    background: #950000;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.lit-retry-btn:hover {
    background: #aa0000;
}

.lit-retry-btn:active {
    background: #7e0000;
}

/* ==========================================================================
   NO JAVASCRIPT FALLBACK
   ========================================================================== */

.lit-no-js-message {
    padding: 20px;
    text-align: center;
    background: #fff3e0;
    border: 1px solid #ffcc02;
    border-radius: 4px;
    margin: 10px;
}

.lit-no-js-message h3 {
    color: #e65100;
    margin-top: 0;
    margin-bottom: 10px;
}

.lit-no-js-message p {
    color: #bf360c;
    margin-bottom: 10px;
    line-height: 1.4;
}

.lit-no-js-message a {
    color: #950000;
    text-decoration: none;
    font-weight: bold;
}

.lit-no-js-message a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   DATE NOTICE
   ========================================================================== */

.lit-date-notice {
    margin-bottom: 15px;
    padding: 10px;
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1.4;
}

.lit-date-notice a {
    color: #950000;
    text-decoration: none;
    font-weight: bold;
}

.lit-date-notice a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE SKELETON ADJUSTMENTS
   ========================================================================== */

@media screen and (max-width: 480px) {
    .lit-skeleton-line {
        height: 14px;
    }
    
    .lit-skeleton .lit-option {
        min-height: 36px;
    }
    
    .lit-skeleton-button {
        height: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lit-skeleton-line,
    .lit-skeleton .lit-option,
    .lit-skeleton-button {
        animation: none;
        background: #f0f0f0;
    }
}

/* ==========================================================================
   GLOBAL OVERRIDES
   ========================================================================== */

.lit-quiz-container * {
    line-height: 1.4;
}
