/**
 * Exodus Game-Specific Styles
 * Using game-specific class selectors for better scoping
 */

/* Main container customization */
.game-stats{
    position: fixed !important;
}

.exodus {
    font-family: 'Palatino', 'Palatino Linotype', 'Book Antiqua', serif;
    color: #333;
    background-color: #f5f5f0;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    /* Set max-height to 90% of viewport height */
    max-height: 90vh;
    /* Prepare for scroll animation */
    overflow: hidden;
}

/* Content panel styling */
.exodus-content {
    background: radial-gradient(circle at center, rgba(255, 252, 240, 0.5) 0%, rgba(245, 236, 203, 0.5) 100%);
    border-radius: 0;
    padding: 25px 30px !important;
    box-shadow: inset 0 0 20px rgba(139, 69, 19, 0.1);
}

/* Stage title in Exodus theme */
.exodus-content .stage-title {
    color: #8b4513;
    font-size: 28px;
    text-align: center;
    font-family: 'Palatino', serif;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(139, 69, 19, 0.3);
    padding-bottom: 10px;
}

/* Content styling */
.exodus-stage-content {
    background-color: rgba(255, 252, 240, 0.9) !important;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(139, 69, 19, 0.2);
    position: relative;
    z-index: 2;
}

/* Add ancient-looking decorative elements */
.exodus-stage-content::before {
    content: "§";
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 20px;
    color: rgba(139, 69, 19, 0.3);
}

.exodus-stage-content::after {
    content: "§";
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 20px;
    color: rgba(139, 69, 19, 0.3);
}

/* Exodus-specific choices */
.exodus-choices {
    margin-top: 15px;
}

.exodus-choices-list {
    border-top: 1px solid rgba(139, 69, 19, 0.2);
    padding-top: 15px;
}

/* Choice button styling */
.exodus-choice-button {
    background-color: #a38566;
    color: #f4f1e6;
    border: 1px solid #7d6549;
    border-radius: 4px;
    padding: 12px 20px 12px 30px;
    font-size: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    font-family: 'Palatino', serif;
}

.exodus-choice-button:before {
    content: "⟩";
    position: absolute;
    left: 10px;
    opacity: 0.7;
}

.exodus-choice-button:hover {
    background-color: #8a6d4f;
    transform: translateY(-2px);
}

.exodus-choice-button:active {
    background-color: #725533;
    transform: translateY(0);
}

/* Control section styling */
.exodus-controls {
    background-color: rgba(121, 85, 72, 0.1);
    border-top: 1px solid rgba(121, 85, 72, 0.3);
    border-radius: 0 0 9px 9px;
}

/* Resource display */
.exodus-stats {
    margin-bottom: 10px;
    padding: 8px 0;
    background-color: rgba(255, 252, 240, 0.7);
    border-bottom: 1px solid rgba(121, 85, 72, 0.2);
    border-radius: 9px 9px 0 0;
}

.exodus-resource-display {
    background-color: rgba(255, 252, 240, 0.9);
    border: 1px solid rgba(121, 85, 72, 0.4);
    border-radius: 4px;
    padding: 5px 10px;
    margin-right: 0;
    font-size: 14px;
    transition: background-color 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.exodus-resource-display:hover {
    background-color: rgba(255, 252, 240, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.exodus-resource-display .resource-name {
    color: #8b4513;
    font-weight: bold;
}

.exodus-resource-display .resource-value {
    color: #333;
    font-weight: bold;
}

/* Resource feedback styling */
.exodus-resource-feedback {
    margin-top: 15px;
    padding: 10px;
    border-top: 1px dashed rgba(121, 85, 72, 0.4);
    background-color: rgba(255, 252, 240, 0.7);
    border-radius: 0 0 4px 4px;
}

.exodus-resource-feedback h4 {
    color: #8b4513;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
}

/* Scroll styling for the entire container */
.exodus-scroll {
    position: relative;
    border-radius: 0 !important;
    background-color: rgba(249, 246, 233, 0.8);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    padding: 20px 40px !important;
    overflow: visible !important;
    max-height: 90vh;
    /* Add animation for the scroll unrolling horizontally */
    animation: scroll-unroll 1.5s ease-out forwards;
    transform-origin: center;
}

/* Scroll wrapper to contain the handles that start centered */
.exodus-scroll::before,
.exodus-scroll::after {
    content: "";
    position: absolute;
    width: 30px;
    height: 100%;
    top: 0;
    background: repeating-linear-gradient(
        to bottom,
        #9b7653,
        #8a6642 10px,
        #9b7653 10px,
        #8a6642 20px
    );
    border-radius: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

/* Initial position for both handles is centered */
.exodus-scroll::before {
    left: 50%;
    margin-left: -15px;
    animation: handle-to-left 1.5s ease-out forwards;
}

.exodus-scroll::after {
    right: 50%;
    margin-right: -15px;
    animation: handle-to-right 1.5s ease-out forwards;
}

/* Handle animations - move to sides without spinning */
@keyframes handle-to-left {
    0% {
        left: 50%;
        margin-left: -15px;
    }
    100% {
        left: -15px;
        margin-left: 0;
    }
}

@keyframes handle-to-right {
    0% {
        right: 50%;
        margin-right: -15px;
    }
    100% {
        right: -15px;
        margin-right: 0;
    }
}

/* Unroll animation - horizontal expansion */
@keyframes scroll-unroll {
    0% {
        transform: scaleX(0.1);
        opacity: 0.2;
    }
    40% {
        transform: scaleX(0.4);
        opacity: 0.7;
    }
    100% {
        transform: scaleX(1);
        opacity: 1;
    }
}

/* Adjustments for transparent content in Exodus game */
.transparent-bg.exodus-content {
    background-color: rgba(255, 252, 240, 0.4) !important;
}

.transparent-bg.exodus-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(255, 252, 240, 0.1), rgba(255, 252, 240, 0.5));
    z-index: 0;
    border-radius: 8px;
}

/* Add scroll texture and shadow effects */
.exodus-scroll::before, 
.exodus-scroll::after {
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 0, 0, 0.3);
}

.exodus-scroll::before {
    background-image: linear-gradient(to right, #8a6642, #9b7653);
}

.exodus-scroll::after {
    background-image: linear-gradient(to left, #8a6642, #9b7653);
}

/* Add parchment texture to the scroll */
.exodus-scroll {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100" opacity="0.05"><rect width="100%" height="100%" fill="none"/><path d="M0,0 L100,100 M100,0 L0,100" stroke="black" stroke-width="0.5"/></svg>');
    background-repeat: repeat;
    background-blend-mode: overlay;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .exodus {
        padding: 10px;
        max-height: 95vh; /* Give a bit more space on mobile */
    }
    
    .exodus-content .stage-title {
        font-size: 22px;
    }
    
    .exodus-stage-content {
        font-size: 14px;
        padding: 15px;
    }
    
    .exodus-choice-button {
        font-size: 14px;
        padding: 10px 15px 10px 25px;
    }
    
    .exodus-resource-display {
        margin-bottom: 5px;
        font-size: 12px;
    }
}
