@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu&display=swap'); /* Urdu Calligraphy */

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: "Poppins", sans-serif; 
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    background: #fef6e4;
}

#main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex-grow: 1;
    width: 100%;
    padding: 20px;
}

#magazine-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-grow: 1;
}

.flipbook {
    width: 1488px !important;
    height: 2105px !important;
    max-width: 50vw;
    max-height: 70vh;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    position: relative;
    z-index: 9999;
    pointer-events: auto;
}

.icon {
    position: relative;
    z-index: 10000;
    pointer-events: auto;
    font-size: 24px; 
    color: #172c66; 
    cursor: pointer; 
    transition: transform 0.3s; 
}
.icon:hover { transform: scale(1.2); }
.icon:active { transform: scale(0.9); }

.home-button {
    position: absolute;
    top: 10px;
    left: 25px;
    width: 48px;
    height: 48px;
    font-size: 24px;
    color: #ffffff;
    background-color: #172c66;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s, transform 0.3s;
}
.home-button:hover { 
    background-color: #ffffff; 
    color: #172c66; 
    transform: scale(1.1); 
}

/* 📱 Mobile optimization */
@media (max-width: 968px) {
    .flipbook {
        width: 100% !important;
        height: 80vh !important;
        max-width: none;
        max-height: none;
    }
}

/* Progress bar */
.progress-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #172c66;
}
progress {
    width: 200px;
    height: 10px;
}

/* Credit animation in Urdu – now below toolbar */
/* Credit animation in Urdu – centered below toolbar */
.credit {
    margin-top: 12px; /* space below toolbar */
    font-size: 20px;
    font-family: 'Noto Nastaliq Urdu', serif;
    direction: rtl;
    text-align: center;
    background: linear-gradient(90deg, #000000, #555555, #000000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: typing 3s steps(30, end) forwards, fadeScale 3s ease forwards, shine 3s linear infinite;
    animation-delay: 0s, 0s, 3s;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    opacity: 0;
    display: block;
    max-width: 120vw; /* prevent cut-off on small screens */
    margin-left: auto;
    margin-right: auto;
}


/* Typing reveal */
@keyframes typing {
    from { width: 0 }
    to { width: 20em; }
}

/* Fade + scale */
@keyframes fadeScale {
    0% { opacity: 0; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

/* Shine animation */
@keyframes shine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .credit {
        font-size: 16px;
    }
    @keyframes typing {
        from { width: 0 }
        to { width: 16em; }
    }
}