* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;

}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 15px;
    padding-bottom: 100px;
    background-image: var(--enews-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--enews-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(10px);
    z-index: -1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
    color: white;
    font-size: clamp(18px, 4vw, 28px);
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(12px, 2.5vw, 16px);
}

/* Loading */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    font-size: clamp(16px, 3vw, 24px);
    font-weight: 600;
    display: none;
    z-index: 1000;
}

.loading.active {
    display: block;
}

.loading::after {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    margin: 20px auto;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: rgb(174 14 5);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Flipbook Wrapper */
.flipbook-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 2500px;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
}

#flipbook {
    background-color: white;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 100px rgba(181, 175, 185, 0.3);
}

#flipbook:hover {
    transform: rotateX(0deg);
}

#flipbook .page {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#flipbook .page canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Navigation Arrows - Desktop */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgb(182 19 17);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nav-arrow:active:not(:disabled) {
    transform: translateY(-50%) scale(0.95);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-arrow svg {
    width: 30px;
    height: 30px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

#prevArrow {
    left: 20px;
}

#nextArrow {
    right: 20px;
}

/* Page Counter */
.page-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgb(174 14 5);
    backdrop-filter: blur(10px);
    padding: 12px 30px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: clamp(14px, 2.5vw, 16px);
    font-weight: 600;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

/* Tablet Styles (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 20px;
        padding-bottom: 100px;
    }

    #flipbook {
        transform: rotateX(2deg);
    }

    .nav-arrow {
        width: 55px;
        height: 55px;
    }

    .nav-arrow svg {
        width: 28px;
        height: 28px;
    }

    #prevArrow {
        left: 15px;
    }

    #nextArrow {
        right: 15px;
    }
}

/* Mobile Landscape (up to 768px landscape) */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 10px;
        padding-bottom: 80px;
    }

    .header {
        padding: 10px 15px;
        margin-bottom: 10px;
    }

    .flipbook-wrapper {
        perspective: 1500px;
    }

    #flipbook {
        transform: rotateX(1deg);
    }

    .nav-arrow {
        width: 45px;
        height: 45px;
    }

    .nav-arrow svg {
        width: 24px;
        height: 24px;
    }

    #prevArrow {
        left: 10px;
    }

    #nextArrow {
        right: 10px;
    }

    .page-counter {
        padding: 8px 20px;
        bottom: 10px;
    }
}

/* Mobile Portrait (up to 768px) */
@media (max-width: 768px) and (orientation: portrait) {
    .container {
        padding: 10px;
        padding-bottom: 90px;
    }

    .header {
        padding: 12px 15px;
        margin-bottom: 15px;
    }

    .flipbook-wrapper {
        perspective: 1500px;
    }

    #flipbook {
        transform: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .nav-arrow {
        width: 50px;
        height: 50px;
    }

    .nav-arrow svg {
        width: 26px;
        height: 26px;
    }

    #prevArrow {
        left: 10px;
    }

    #nextArrow {
        right: 10px;
    }

    .page-counter {
        padding: 10px 25px;
        bottom: 15px;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    .container {
        padding: 8px;
        padding-bottom: 80px;
    }

    .header {
        padding: 10px;
        margin-bottom: 10px;
        border-radius: 10px;
    }

    .flipbook-wrapper {
        perspective: 1200px;
    }

    #flipbook {
        transform: none;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    }

    .nav-arrow {
        width: 45px;
        height: 45px;
    }

    .nav-arrow svg {
        width: 22px;
        height: 22px;
    }

    #prevArrow {
        left: 8px;
    }

    #nextArrow {
        right: 8px;
    }

    .page-counter {
        padding: 8px 20px;
        bottom: 12px;
        font-size: 13px;
    }
}

/* Extra Small Mobile (up to 360px) */
@media (max-width: 360px) {
    .container {
        padding: 5px;
        padding-bottom: 75px;
    }

    .header {
        padding: 8px;
        margin-bottom: 8px;
    }

    .nav-arrow {
        width: 40px;
        height: 40px;
    }

    .nav-arrow svg {
        width: 20px;
        height: 20px;
    }

    #prevArrow {
        left: 5px;
    }

    #nextArrow {
        right: 5px;
    }

    .page-counter {
        padding: 6px 15px;
        bottom: 10px;
        font-size: 12px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-arrow {
        background: rgb(174 14 5);
    }

    .nav-arrow:active:not(:disabled) {
        background: rgb(174 14 5);
    }

    #flipbook {
        touch-action: pan-y pinch-zoom;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    #flipbook .page canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}