:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --text-color: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
    opacity: 0;
    animation: fadeInBody 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes fadeInBody {
    to {
        opacity: 1;
    }
}

header {
    background-color: var(--secondary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transform: translateY(-100%);
    animation: slideDownHeader 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s forwards;
}

@keyframes slideDownHeader {
    to {
        transform: translateY(0);
    }
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.5s forwards;
}

.logo i {
    margin-right: 10px;
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 1.5rem;
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeInUp 0.5s ease-out forwards;
}

nav ul li:nth-child(1) { animation-delay: 0.6s; }
nav ul li:nth-child(2) { animation-delay: 0.7s; }
nav ul li:nth-child(3) { animation-delay: 0.8s; }
nav ul li:nth-child(4) { animation-delay: 0.9s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

nav ul li a:hover {
    color: var(--primary-color);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
    transform-origin: left;
}

nav ul li a:hover::after {
    width: 100%;
    animation: lineExpand 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes lineExpand {
    0% {
        transform: scaleX(0);
    }
    100% {
        transform: scaleX(1);
    }
}

.hero {
    background: linear-gradient(rgba(44, 62, 80, 0.8), rgba(44, 62, 80, 0.9)), url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?ixlib=rb-4.0.3&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.4s forwards;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.6s forwards;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.8s forwards;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid white;
}

.btn-outline:hover {
    background-color: white;
    color: var(--secondary-color);
    transform: translateY(-3px) scale(1.05);
}

section {
    padding: 4rem 0;
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUpSection 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes fadeInUpSection {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    animation: expandLine 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.8s forwards;
}

@keyframes expandLine {
    to {
        transform: translateX(-50%) scaleX(1);
    }
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.book-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(50px) rotateX(15deg);
    animation: cardEntrance 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    display: flex;
    flex-direction: column;
    height: 100%;
}

@keyframes cardEntrance {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.book-card:nth-child(1) { animation-delay: 0.1s; }
.book-card:nth-child(2) { animation-delay: 0.2s; }
.book-card:nth-child(3) { animation-delay: 0.3s; }
.book-card:nth-child(4) { animation-delay: 0.4s; }
.book-card:nth-child(5) { animation-delay: 0.5s; }
.book-card:nth-child(6) { animation-delay: 0.6s; }

.book-card:hover {
    transform: translateY(-10px) scale(1.02) rotateZ(1deg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.book-cover {
    height: 630px;
    overflow: hidden;
    position: relative;
}

.book-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 100%);
    opacity: 0;
    transition: var(--transition);
}

.book-card:hover .book-cover::after {
    opacity: 1;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    filter: grayscale(0.1);
}

.book-card:hover .book-cover img {
    transform: scale(1.1);
    filter: grayscale(0);
}

.book-info {
    padding: 1.5rem;
    background: white;
    position: relative;
    z-index: 2;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    transition: var(--transition);
}

.book-card:hover .book-title {
    color: var(--primary-color);
}

.book-author {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 1rem;
    transform: translateX(-10px);
    opacity: 0;
    animation: slideInRight 0.5s ease-out 0.5s forwards;
}

@keyframes slideInRight {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.book-description {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.7s forwards;
    flex-grow: 1;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.book-upload-date {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.book-upload-date::before {
    content: "📅";
    font-size: 0.8rem;
}

.book-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
}

.book-actions .btn {
    opacity: 1;
    transform: none;
    animation: none;
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.book-actions .btn:hover {
    transform: translateY(-2px) scale(1.05);
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #1a252f;
    transform: translateY(-2px) scale(1.05);
}

.about-section {
    background-color: var(--light-color);
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3rem;
}

.author-photo {
    flex: 1;
    min-width: 300px;
    text-align: center;
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.author-photo img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: var(--shadow);
    transition: var(--transition);
    filter: grayscale(0.2);
}

.author-photo:hover img {
    transform: scale(1.05) rotate(5deg);
    filter: grayscale(0);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.author-info {
    flex: 2;
    min-width: 300px;
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s forwards;
}

.author-info h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.author-info p {
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.author-info p:nth-child(1) { animation-delay: 0.7s; }
.author-info p:nth-child(2) { animation-delay: 0.8s; }
.author-info p:nth-child(3) { animation-delay: 0.9s; }

.contact-info {
    margin-top: 2rem;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 1s forwards;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    margin-right: 1.5rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.contact-info a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.contact-info a:hover::after {
    width: 100%;
}

.contact-info i {
    margin-right: 8px;
    transition: var(--transition);
}

.contact-info a:hover i {
    transform: scale(1.2) translateX(3px);
}

footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.social-links {
    margin: 1.5rem 0;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    margin: 0 1rem;
    transition: var(--transition);
    display: inline-block;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-5px) scale(1.2);
}

.copyright {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #bdc3c7;
}

/* Modal for book preview */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow: auto;
    opacity: 0;
    animation: modalFadeIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalFadeIn {
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(-50px);
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalSlideIn {
    to {
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    color: var(--secondary-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
    transition: var(--transition);
    padding: 5px;
    border-radius: 50%;
}

.close-modal:hover {
    color: var(--accent-color);
    background-color: #f5f5f5;
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
    min-height: 500px;
}

/* PDF Preview Styles */
#pdf-canvas {
    width: 100%;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.3s forwards;
}

.pdf-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.5s forwards;
}

.pdf-controls button {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.pdf-controls button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* EPUB Preview Styles */
#epub-viewer {
    width: 100%;
    height: 600px;
    border: 1px solid #ddd;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.3s forwards;
}

/* Scroll animations */
.fade-in-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fade-in-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hover effects for interactive elements */
.book-card, .btn, .author-photo img, .social-links a, .contact-info a {
    will-change: transform;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        margin-top: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    nav ul li {
        margin: 0.5rem;
        opacity: 1;
        transform: none;
        animation: none;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .author-photo, .author-info {
        flex: 1;
    }
    
    .book-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .book-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Adjust animations for mobile */
    .book-card {
        transform: translateY(30px);
        animation: fadeInUp 0.6s ease-out forwards;
    }
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}




#radioBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #111;
  color: white;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 0 15px rgba(0,0,0,.4);
}

#radioPanel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 300px;
  background: #0d1117;
  border-radius: 12px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
}

#radioMessages {
  height: 200px;
  padding: 10px;
  overflow-y: auto;
  color: white;
  font-size: 14px;
}

#radioInput {
  border: none;
  padding: 10px;
  background: #161b22;
  color: white;
  outline: none;
}

/* =====================================================
   🎧 LifeArena – Radio Chatbot (ULTRA PREMIUM CSS)
===================================================== */

/* =========================
   🎵 RADIO BUTTON
========================= */

#radioBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #1f6feb, #4c8dff);
  color: white;
  font-size: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#radioBtn:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

/* =========================
   💬 CHAT PANEL
========================= */

#radioPanel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 320px;
  max-height: 420px;
  background: #0d1117;
  border-radius: 14px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

/* Messages */
#radioMessages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  font-size: 14px;
  color: #e6edf3;
  line-height: 1.5;
}

#radioMessages::-webkit-scrollbar {
  width: 6px;
}
#radioMessages::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 10px;
}

/* Chat input */
#radioInput {
  border: none;
  padding: 12px;
  background: #161b22;
  color: white;
  outline: none;
  font-size: 14px;
}

/* Messages */
.bot-message {
  margin-bottom: 8px;
  color: #dbeafe;
}

.user-message {
  margin-bottom: 8px;
  color: #c9d1d9;
}

/* =========================
   🎧 MUSIC POPUP
========================= */

.music-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  max-width: 90vw;
  background: #0d1117;
  border-radius: 16px;
  padding: 12px;
  color: white;
  z-index: 999999;
  cursor: grab;
  user-select: none;
  touch-action: none;         /* 🔥 required */
  will-change: transform;     /* 🔥 smooth */
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.music-popup.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

/* =========================
   🎵 POPUP HEADER
========================= */

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.now-playing {
  font-size: 13px;
  color: #c9d1d9;
}

.close-music {
  background: transparent;
  border: none;
  color: #8b949e;
  cursor: pointer;
  font-size: 14px;
}

.close-music:hover {
  color: #ff4d4d;
}

/* =========================
   📊 PROGRESS BAR
========================= */

.progress-container {
  width: 100%;
  height: 6px;
  background: #161b22;
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1f6feb, #58a6ff);
  transition: width 0.15s linear;
}

/* =========================
   🎛️ CONTROLS
========================= */

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
}

.control-btn {
  background: #161b22;
  border: none;
  color: white;
  font-size: 18px;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.control-btn:hover {
  background: #1f6feb;
  transform: scale(1.15);
}

/* =========================
   🔊 BOTTOM CONTROLS
========================= */

.bottom-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-icon {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

.volume-slider {
  width: 80px;
}

/* Time */
.time-display {
  font-size: 11px;
  color: #8b949e;
}

/* Mood button */
.mood-btn {
  background: #161b22;
  border: none;
  border-radius: 50%;
  padding: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.mood-btn:hover {
  transform: rotate(15deg) scale(1.2);
}

/* =========================
   📱 RESPONSIVE
========================= */

@media (max-width: 480px) {
  #radioPanel {
    width: 95%;
    right: 2.5%;
  }

  .music-popup {
    width: 95%;
    right: 2.5%;
  }
}

