/* ========================================
   DRAGON WHEEL THEME - MODAL STYLING
   EXCLUDES HISTORY MODAL
   ======================================== */

/* ===== MODAL CONTAINER (NOT HISTORY) ===== */
.popup-container:not(#popup-container-history) {
    width: 100%;
    height: 100%;
    position: fixed;
    z-index: 1000;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 20, 20, 0.9) 50%, rgba(0, 0, 0, 0.95) 100%);
    backdrop-filter: blur(5px);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== MODAL BODY - ENHANCED STRUCTURE (NOT HISTORY) ===== */
.popup-container:not(#popup-container-history) .popup-body {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    margin: auto;
    background: linear-gradient(145deg, #2C1810 0%, #1C1C1C 50%, #0D0D0D 100%);
    border: 3px solid #FFD700;
    border-radius: 15px;
    color: #FFE4B5;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.5),
        inset 0 2px 5px rgba(255, 215, 0, 0.2),
        0 0 30px rgba(255, 165, 0, 0.3);
    overflow: hidden;
    position: relative;
    animation: modalSlideIn 0.5s ease-out;
}

@keyframes modalSlideIn {
    from { 
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ===== DRAGON DECORATIVE BORDER (NOT HISTORY) ===== */
.popup-container:not(#popup-container-history) .popup-body:before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FFD700, #FF6B35, #8B0000, #FFD700);
    z-index: -1;
    border-radius: 15px;
    animation: rotateBorder 4s linear infinite;
}

@keyframes rotateBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== MODAL HEADER (NOT HISTORY) ===== */
.popup-container:not(#popup-container-history) .popup-header {
    height: 60px;
    width: 100%;
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 25%, #FFD700 50%, #FFA500 75%, #FF8C00 100%);
    border-bottom: 2px solid #8B0000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.popup-container:not(#popup-container-history) .popup-header:before {
    content: '';
    position: absolute;
    left: 20px;
    font-size: 24px;
    animation: dragonPulse 2s ease-in-out infinite;
}

.popup-container:not(#popup-container-history) .popup-header:after {
    content: '';
    position: absolute;
    right: 20px;
    font-size: 24px;
    animation: dragonPulse 2s ease-in-out infinite reverse;
}

@keyframes dragonPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.popup-container:not(#popup-container-history) .popup-header h6 {
    margin: 0;
    font-family: 'Lilita One', cursive;
    font-size: 20px;
    font-weight: 900;
    color: #000;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

/* ===== MODAL CLOSE BUTTON (NOT HISTORY) ===== */
.popup-container:not(#popup-container-history) .popup-close {
    cursor: pointer;
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, #8B0000 0%, #DC143C 50%, #B22222 100%);
    color: #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: absolute;
    top: -15px;
    right: -15px;
    border: 3px solid #FFD700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 10;
}

.popup-container:not(#popup-container-history) .popup-close:hover {
    background: linear-gradient(145deg, #DC143C 0%, #FF0000 50%, #FF6347 100%);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.popup-container:not(#popup-container-history) .popup-close:active {
    transform: scale(0.95) rotate(90deg);
}

/* ===== MODAL CONTENT AREA (NOT HISTORY) ===== */
.popup-container:not(#popup-container-history) .modal-content-area {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    background: rgba(44, 24, 16, 0.3);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.popup-container:not(#popup-container-history) .modal-content-area::-webkit-scrollbar {
    width: 8px;
}

.popup-container:not(#popup-container-history) .modal-content-area::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.popup-container:not(#popup-container-history) .modal-content-area::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, #FFD700, #B8860B);
    border-radius: 4px;
}

.popup-container:not(#popup-container-history) .modal-content-area::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, #FFA500, #DAA520);
}

/* ===== MODAL FOOTER (NOT HISTORY) ===== */
.popup-container:not(#popup-container-history) .modal-footer {
    padding: 15px 20px;
    background: linear-gradient(135deg, #1C1C1C 0%, #2C1810 50%, #0D0D0D 100%);
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    display: flex;
    justify-content: center;
    gap: 15px;
}

.popup-container:not(#popup-container-history) .modal-footer .btn {
    font-family: 'Lilita One', cursive;
    font-size: 16px;
    padding: 8px 20px;
    border-radius: 25px;
    border: 2px solid #FFD700;
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 50%, #B22222 100%);
    color: #FFD700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.popup-container:not(#popup-container-history) .modal-footer .btn:hover {
    background: linear-gradient(135deg, #DC143C 0%, #FF0000 50%, #FF6347 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.4);
}

.popup-container:not(#popup-container-history) .modal-footer .btn-primary {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 50%, #FFD700 100%);
    color: #000;
}

.popup-container:not(#popup-container-history) .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #DAA520 0%, #FFD700 50%, #FFFF00 100%);
    box-shadow: 0 5px 15px rgba(218, 165, 32, 0.4);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .popup-container:not(#popup-container-history) .popup-body {
        width: 95%;
        margin: 20px auto;
    }
    
    .popup-container:not(#popup-container-history) .popup-header {
        height: 50px;
    }
    
    .popup-container:not(#popup-container-history) .popup-header h6 {
        font-size: 16px;
    }
    
    .popup-container:not(#popup-container-history) .popup-header:before,
    .popup-container:not(#popup-container-history) .popup-header:after {
        font-size: 18px;
    }
    
    .popup-container:not(#popup-container-history) .modal-content-area {
        max-height: 300px;
        padding: 15px;
    }
    
    .popup-container:not(#popup-container-history) .modal-footer {
        padding: 10px 15px;
        flex-direction: column;
    }
    
    .popup-container:not(#popup-container-history) .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .popup-container:not(#popup-container-history) .popup-body {
        width: 98%;
        margin: 10px auto;
        border-radius: 10px;
    }
    
    .popup-container:not(#popup-container-history) .popup-header {
        height: 45px;
    }
    
    .popup-container:not(#popup-container-history) .popup-header h6 {
        font-size: 14px;
    }
    
    .popup-container:not(#popup-container-history) .popup-close {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

/* ===== MODAL ANIMATIONS (NOT HISTORY) ===== */
.popup-container:not(#popup-container-history) .modal-content-area.fade-in {
    animation: contentFadeIn 0.6s ease-out;
}

@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== TABLE STYLING INSIDE MODALS ===== */
.modal-content-area table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.modal-content-area table th {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
    color: #FFD700;
    padding: 12px 8px;
    font-weight: bold;
    text-align: center;
    font-family: 'Lilita One', cursive;
}

.modal-content-area table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    color: #FFE4B5;
}

.modal-content-area table tr:hover {
    background: rgba(255, 215, 0, 0.1);
}

.modal-content-area table tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.1);
}