/**
 * Style dla poziomu III - Ekspert Wężowy
 * Specjalne style dla mechaniki poziomu trzeciego (zagadki)
 */

/* Główny kontener poziomu III */
.level3-game {
    border-radius: 20px;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Obszar zagadki */
.puzzle-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.puzzle-container {
    max-width: 900px;
    margin: 0 auto;
}

.puzzle-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
}

.puzzle-content {
    margin-bottom: 30px;
    min-height: 200px;
}

/* Rebus */
.rebus-puzzle {
    text-align: center;
}

.rebus-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Zagadka rymowana */
.rhyme-puzzle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    font-size: 1.2rem;
    line-height: 1.8;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.rhyme-text {
    font-style: italic;
    white-space: pre-line;
}

/* Zagadka gramatyczna */
.grammar-puzzle {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.grammar-options {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
}

.option-label:hover {
    border-color: #3498db;
    background: #e3f2fd;
    transform: translateX(5px);
}

.option-label input[type="radio"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #3498db;
}

/* Krzyżówka */
.crossword-puzzle {
    background: #fff9e6;
    padding: 25px;
    border-radius: 10px;
    border: 2px solid #f4d03f;
}

.crossword-hint {
    margin-top: 15px;
    font-weight: 600;
    color: #856404;
}

/* Pole odpowiedzi */
.puzzle-answer-area {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.puzzle-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.puzzle-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Podpowiedzi */
.puzzle-hints {
    margin-bottom: 20px;
}

.hint-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hint-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.hint-display {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 5px;
    color: #856404;
}

/* Wizualizacja węża - identycznie jak w poziomie 2 */
.snake-visualization-container {
    padding: 0;
    margin: 150px 0 20px 0;
    background: transparent;
    box-shadow: none;
}

.snake-visualization-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fafafa;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.snake-visualization {
    position: relative;
    width: 100%;
    height: 740px;
    border-radius: 8px;
    overflow: hidden;
}

.snake-sketch {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: opacity 1.5s ease;
    object-fit: contain;
}

.snake-sketch.fading {
    opacity: 0;
}

.snake-realistic {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease;
    object-fit: contain;
}

.snake-realistic.showing {
    opacity: 1;
}

.snake-visualization img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.snake-visualization img:hover {
    transform: scale(1.05);
}

.snake-svg {
    width: 100%;
    height: 100%;
}

/* Modal ze szczegółami */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close-modal:hover,
.close-modal:focus {
    color: #000;
}

/* Zakładki w szczegółach węża */
.snake-details-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #3498db;
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 20px 0;
}

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

/* Detale skóry, rentgen, gniazda */
.skin-detail,
.xray-detail,
.nest-detail {
    text-align: center;
}

.skin-detail img,
.xray-detail img,
.nest-detail img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
}

/* Fauna i flora */
.fauna-flora-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.fauna-flora-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.fauna-flora-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.fauna-flora-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.item-info h4 {
    margin: 10px 0 5px;
    color: #2c3e50;
}

.english-name {
    color: #7f8c8d;
    font-style: italic;
    font-size: 0.9rem;
}

/* Film */
.video-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.video-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.video-modal-content video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
}

.close-video-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
}

.video-description {
    color: white;
    text-align: center;
    margin-top: 15px;
}

/* Mapa i informacje */
.info-map-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.info-map-content {
    background-color: #fefefe;
    margin: 3% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

.close-info-map {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-info-map:hover {
    color: #000;
}

.interactive-map-container {
    margin-top: 30px;
}

.map-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.map-controls button {
    padding: 10px 20px;
    font-size: 1.2rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-controls button:hover {
    background: #2980b9;
}

.interactive-map {
    position: relative;
    overflow: hidden;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #f0f0f0;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#map-image {
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
    cursor: move;
}

.ambience-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.ambience-btn:hover {
    background: #229954;
}

/* Feedback */
.feedback-message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-weight: 600;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: visible;
    opacity: 1;
}

.feedback-message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.feedback-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.feedback-message.partial {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffeaa7;
}

/* Kontrolki gry - przeniesione do głównego boxa */
.game-controls-inline {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    flex-wrap: wrap;
}

.game-controls {
    display: none; /* Ukryj stare kontrolki */
}

.game-controls-inline .control-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
}

.control-btn {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Modal summary - używa tych samych stylów co poziom 2 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: min(90vw, 520px);
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

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

.modal-body p {
    margin: 8px 0;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.snake-facts {
    margin-top: 15px;
    text-align: left;
}

.snake-facts h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.snake-facts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.snake-facts li {
    padding: 8px 12px;
    margin: 5px 0;
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    border-radius: 5px;
    color: #34495e;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #000;
}

.back-btn {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

/* Dyplom */
.diploma-modal {
    display: none;
    position: fixed;
    z-index: 1003;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.diploma-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.close-diploma {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-diploma:hover {
    color: #000;
}

.diploma-body {
    text-align: center;
}

.diploma-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin: 20px 0;
    font-weight: 700;
}

.diploma-achievement {
    font-size: 1.5rem;
    color: #e74c3c;
    margin: 20px 0;
}

.diploma-snake-image {
    margin: 30px 0;
}

.diploma-snake-image img {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.diploma-stats {
    margin: 30px 0;
    text-align: left;
    display: inline-block;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.diploma-stats p {
    margin: 10px 0;
    font-size: 1.1rem;
}

.diploma-date {
    margin: 20px 0;
    color: #7f8c8d;
}

.diploma-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.diploma-btn {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.diploma-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.diploma-btn.secondary {
    background: #95a5a6;
}

.diploma-btn.secondary:hover {
    background: #7f8c8d;
}

/* Model 3D download */
.model-download-modal {
    display: none;
    position: fixed;
    z-index: 1004;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.model-download-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    position: relative;
}

.close-model-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close-model-modal:hover {
    color: #000;
}

.model-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.model-info p {
    margin: 8px 0;
}

.model-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.model-btn {
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.model-btn:hover {
    background: #229954;
}

.model-btn.secondary {
    background: #95a5a6;
}

.model-btn.secondary:hover {
    background: #7f8c8d;
}

/* Responsywność */
@media (max-width: 768px) {
    .puzzle-answer-area {
        flex-direction: column;
    }
    
    .game-controls-inline {
        flex-direction: column;
    }
    
    .snake-details-tabs {
        flex-wrap: wrap;
    }
    
    .fauna-flora-items {
        grid-template-columns: 1fr;
    }
    
    .interactive-map {
        min-height: 300px;
    }
    
    .diploma-content {
        padding: 20px;
        margin: 20px;
    }
    
    .diploma-title {
        font-size: 1.8rem;
    }
    
    .diploma-buttons {
        flex-direction: column;
    }
}

/* Animacje */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Popup o odblokowaniu sekcji */
.section-unlocked-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1005;
    animation: popupIn 0.5s ease;
}

.section-unlocked-popup.fade-out {
    animation: popupOut 0.5s ease;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 300px;
}

.popup-content h3 {
    color: #27ae60;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.popup-content p {
    margin: 10px 0;
    color: #2c3e50;
}

@keyframes popupIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes popupOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

.tab-content.active {
    animation: fadeIn 0.3s ease;
}

.puzzle-content {
    animation: fadeIn 0.5s ease;
}

