/* ========================================
   ANCIENT SCROLL UI - CSS Component
   For Event Followers - The Unknown Room
   ======================================== */

/* Scroll Container */
.scroll-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1500px;
}

/* The Rolled Scroll */
.ancient-scroll {
    position: relative;
    width: 200px;
    height: 320px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.ancient-scroll:hover {
    transform: scale(1.05);
}

.ancient-scroll.open {
    pointer-events: none;
}

/* Scroll Roll (Top) */
.scroll-roll-top {
    position: absolute;
    top: 0;
    left: -15px;
    right: -15px;
    height: 35px;
    background: linear-gradient(180deg, #3a2510 0%, #5a3d20 50%, #3a2510 100%);
    border-radius: 50px;
    box-shadow:
        0 5px 15px rgba(0,0,0,0.5),
        inset 0 -5px 10px rgba(0,0,0,0.3),
        inset 0 5px 10px rgba(255,200,100,0.1);
    z-index: 10;
}

/* Scroll Roll End Caps */
.scroll-roll-top::before,
.scroll-roll-top::after {
    content: '';
    position: absolute;
    top: 5px;
    width: 25px;
    height: 25px;
    background: radial-gradient(circle, #6a4d30 0%, #3a2510 70%);
    border-radius: 50%;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.scroll-roll-top::before {
    left: 5px;
}

.scroll-roll-top::after {
    right: 5px;
}

/* Scroll Roll (Bottom) */
.scroll-roll-bottom {
    position: absolute;
    bottom: 0;
    left: -15px;
    right: -15px;
    height: 35px;
    background: linear-gradient(180deg, #3a2510 0%, #5a3d20 50%, #3a2510 100%);
    border-radius: 50px;
    box-shadow:
        0 -5px 15px rgba(0,0,0,0.5),
        inset 0 5px 10px rgba(0,0,0,0.3),
        inset 0 -5px 10px rgba(255,200,100,0.1);
    z-index: 10;
}

.scroll-roll-bottom::before,
.scroll-roll-bottom::after {
    content: '';
    position: absolute;
    top: 5px;
    width: 25px;
    height: 25px;
    background: radial-gradient(circle, #6a4d30 0%, #3a2510 70%);
    border-radius: 50%;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.scroll-roll-bottom::before {
    left: 5px;
}

.scroll-roll-bottom::after {
    right: 5px;
}

/* Scroll Paper (visible portion) */
.scroll-paper {
    position: absolute;
    top: 30px;
    bottom: 30px;
    left: 0;
    right: 0;
    background: linear-gradient(180deg,
        #d4c4a0 0%,
        #e8dcc4 10%,
        #f0e6d0 50%,
        #e8dcc4 90%,
        #d4c4a0 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-shadow: inset 0 0 30px rgba(139,90,43,0.3);
}

/* Parchment texture */
.scroll-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Scroll Title */
.scroll-title {
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-size: 1.1rem;
    color: #3a2510;
    text-align: center;
    margin-bottom: 15px;
    z-index: 1;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Scroll Symbol */
.scroll-symbol {
    font-size: 3rem;
    margin-bottom: 15px;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Scroll Instruction */
.scroll-instruction {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    color: #5a4a3a;
    z-index: 1;
    opacity: 0.8;
}

/* ========================================
   OPENED SCROLL STATE
   ======================================== */

.scroll-opened {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: linear-gradient(180deg,
        rgba(212,196,160,0.95) 0%,
        rgba(240,230,208,0.95) 50%,
        rgba(212,196,160,0.95) 100%
    );
    border-radius: 10px;
}

.scroll-opened.visible {
    display: flex;
    opacity: 1;
}

/* Scroll Header */
.scroll-header {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: #3a2510;
    text-align: center;
    padding: 10px 0 20px;
    border-bottom: 2px solid rgba(58,37,16,0.2);
    letter-spacing: 3px;
}

/* Scrolls List */
.scrolls-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

/* Individual Scroll Entry */
.scroll-entry {
    background: rgba(255,255,255,0.4);
    border: 1px solid rgba(58,37,16,0.2);
    border-radius: 8px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.scroll-entry:hover {
    background: rgba(255,255,255,0.6);
    border-color: #8b5a2b;
    transform: translateX(5px);
    box-shadow: 0 3px 15px rgba(139,90,43,0.2);
}

.scroll-entry .entry-number {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: #8b5a2b;
    opacity: 0.6;
    min-width: 30px;
}

.scroll-entry .entry-content {
    flex: 1;
}

.scroll-entry h3 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: #3a2510;
    margin-bottom: 5px;
}

.scroll-entry .subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    color: #5a4a3a;
}

.scroll-entry .read-arrow {
    font-size: 1.2rem;
    color: #8b5a2b;
    opacity: 0;
    transition: opacity 0.3s;
}

.scroll-entry:hover .read-arrow {
    opacity: 1;
}

/* Close Scroll Button */
.close-scroll-btn {
    background: rgba(139,90,43,0.1);
    border: 1px solid #8b5a2b;
    color: #3a2510;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    align-self: center;
    margin-top: 15px;
}

.close-scroll-btn:hover {
    background: rgba(139,90,43,0.2);
}

/* ========================================
   ARTICLE VIEW (for scroll)
   ======================================== */

.scroll-article-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: linear-gradient(180deg,
        rgba(212,196,160,0.98) 0%,
        rgba(240,230,208,0.98) 50%,
        rgba(212,196,160,0.98) 100%
    );
    border-radius: 10px;
}

.scroll-article-view.visible {
    display: flex;
    opacity: 1;
}

.scroll-article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid rgba(58,37,16,0.2);
}

.back-to-scrolls {
    background: none;
    border: 1px solid #8b5a2b;
    color: #3a2510;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

.back-to-scrolls:hover {
    background: rgba(139,90,43,0.1);
}

.scroll-title-header {
    font-family: 'Cinzel', serif;
    color: #3a2510;
    font-size: 0.95rem;
}

/* Scroll Article Content */
.scroll-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.scroll-content-wrapper h1 {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    color: #3a2510;
    margin-bottom: 10px;
}

.scroll-content-wrapper .article-subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    color: #5a4a3a;
    margin-bottom: 25px;
    font-style: italic;
}

.scroll-content-wrapper .article-body {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05rem;
    color: #3a2510;
    line-height: 1.8;
}

.scroll-content-wrapper .article-body p {
    margin-bottom: 18px;
    text-align: justify;
}

.scroll-content-wrapper .article-body strong {
    color: #8b5a2b;
}

.scroll-content-wrapper .article-body em {
    color: #6a4a3a;
}

.scroll-content-wrapper .article-body .source {
    font-style: italic;
    color: #6a5a4a;
    border-left: 3px solid #8b5a2b;
    padding-left: 15px;
    margin-top: 30px;
}

/* ========================================
   SCROLL UNROLL ANIMATION
   ======================================== */

@keyframes scrollUnroll {
    0% {
        transform: scaleY(0.1);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scaleY(1);
    }
}

.scroll-opened.unrolling {
    animation: scrollUnroll 0.6s ease-out forwards;
    transform-origin: top center;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 600px) {
    .ancient-scroll {
        width: 160px;
        height: 260px;
    }

    .scroll-title {
        font-size: 0.95rem;
    }

    .scroll-symbol {
        font-size: 2.5rem;
    }

    .scroll-entry {
        padding: 12px 15px;
    }

    .scroll-entry h3 {
        font-size: 0.9rem;
    }
}
