:root {
    --primary-green: #1a3c34; /* Deep forest green */
    --gold-accent: #f1c40f;   /* Vibrant gold */
    --coral-glow: #e74c3c;    /* Festive coral */
    --cream-bg: #f9e8c9;      /* Warm cream */
    --textži-dark: #2c3e50;     /* Rich navy text */
    --shadow: rgba(241, 196, 15, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

body {
    background: var(--cream-bg);
    font-family: 'Lora', serif;
    color: var(--text-dark);
    overflow-x: hidden;
    position: relative;
}

/* Header */
.eid-header {
    position: relative;
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--primary-green), var(--gold-accent));
    color: white;
    box-shadow: 0 4px 20px var(--shadow);
}

.eid-header .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"%3E%3Cpath d="M25 10L30 20L40 20L32 28L35 40L25 33L15 40L18 28L10 20L20 20Z" fill="%23f1c40f"/%3E%3C/svg%3E');
    opacity: 0.1;
    animation: floatStars 20s linear infinite;
}

.eid-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    text-shadow: 0 0 15px var(--shadow);
}

.eid-header p {
    font-size: 1.5rem;
    margin: 10px 0;
}

.header-decor span {
    font-size: 2rem;
    margin: 0 15px;
    animation: bounce 2s infinite;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    padding: 40px 20px;
    background: var(--primary-green);
    color: white;
}

.welcome-section h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    margin-bottom: 15px;
}

.welcome-section p {
    font-size: 1.2rem;
}

/* Search Bar */
.search-bar {
    max-width: 600px;
    margin: 30px auto;
    display: flex;
    align-items: center;
    background: white;
    padding: 10px;
    border-radius: 50px;
    box-shadow: 0 4px 15px var(--shadow);
}

#bookSearch {
    flex: 1;
    border: none;
    padding: 10px;
    font-size: 1.1rem;
    outline: none;
}

.search-btn {
    background: var(--gold-accent);
    border: none;
    padding: 10px 20px;
    border-radius: 50%;
    cursor: pointer;
    color: white;
}

.search-btn:hover {
    background: var(--coral-glow);
}

/* Book Shelf */
.book-shelf {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 6px 25px var(--shadow);
}

.shelf-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--primary-green);
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.shelf-title::after {
    content: '🌙';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: spin 6s linear infinite;
}

.book-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.book-card {
    position: relative;
    text-align: center;
    cursor: pointer;
    padding: 15px;
    background: var(--cream-bg);
    border-radius: 15px;
    box-shadow: 0 4px 15px var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-card img {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: 10px;
    transition: transform 0.5s ease;
}

.book-card:hover img {
    transform: scale(1.1) rotate(2deg);
}

.book-info {
    padding: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-info h4 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.read-btn {
    background: var(--gold-accent);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
}

.read-btn:hover {
    background: var(--coral-glow);
}

/* PDF Viewer */
.pdf-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.pdf-viewer.active {
    display: flex;
}

.pdf-content {
    width: 90%;
    height: 90%;
    background: white;
    border-radius: 20px;
    padding: 20px;
    position: relative;
}

#pdfDisplay {
    width: 100%;
    height: 100%;
    border: none;
}

.close-viewer {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--coral-glow);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
}

.close-viewer:hover {
    background: var(--gold-accent);
    transform: rotate(90deg);
}

/* Footer */
.eid-footer {
    text-align: center;
    padding: 30px;
    background: var(--primary-green);
    color: white;
    box-shadow: 0 -4px 15px var(--shadow);
}

.footer-decor span {
    font-size: 2rem;
    margin: 0 15px;
    animation: pulse 2s infinite;
}

/* Animations */
@keyframes floatStars {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes spin {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Confetti */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: fall 5s linear forwards;
    z-index: 999;
}

@keyframes fall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .eid-header h1 { font-size: 2.5rem; }
    .shelf-title { font-size: 2rem; }
    .book-gallery { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .book-card img { max-height: 200px; }
}

/* Portrait Mode Specific Adjustments */
@media (orientation: portrait) {
    .book-card {
        padding: 10px;
    }
    .book-card img {
        width: 100%;
        max-height: 180px;
        height: auto;
        object-fit: contain;
        margin: 0 auto;
    }
    .book-gallery {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    .book-info h4 {
        font-size: 1rem;
    }
    .read-btn {
        padding: 6px 12px;
    }
}