/* books.css */
/* books.css - Updated Header and Toggle Styles */
/* ===== CSS Variables ===== */
:root {
    --primary: #2c3e50;
    --secondary: #8e44ad;
    --accent: #8e44ad;
    --light: #f9f9fb;
    --dark: #1b1b1b;
    --white: #fff;
    --text: #333;
    --secondary-color: #3498db;
    --amazon: #ff9900;
}

/* ===== Base Styles ===== */
* {
    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);
    background: var(--light);
    overflow-x: hidden;
}

/* ===== Header ===== */
header {
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  position: relative;
}

/* logo */
.logo {
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  flex: 1;
}

.logo i {
  margin-right: 0.5rem;
  color: #3498db;
}

/* menu toggle */
.menu-toggle {
  font-size: 1.5rem;
  cursor: pointer;
  display: none; /* hidden on desktop */
  transition: transform 0.3s ease;
}

.menu-toggle.active i::before {
  content: "\f00d"; /* FontAwesome close icon */
}

/* navigation */
nav ul {
  display: flex;
  gap: 1rem;
  list-style: none;
}

nav ul li a {
  text-decoration: none;
  color: #333;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  transition: background 0.3s;
}

nav ul li a:hover,
nav ul li a.active {
  background: #3498db;
  color: #fff;
}

/* ===== Mobile Styling ===== */
@media (max-width: 768px) {
  .menu-toggle {
    display: block; /* show on mobile */
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
  }

  .logo {
    justify-content: flex-start;
    padding-right: 2.5rem; /* Space for the toggle */
  }

  nav {
    position: absolute;
    top: 100%; /* directly under header */
    left: 0;
    width: 100%;
    background: #fff;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }

  nav.active {
    max-height: 500px; /* enough to fit all links */
  }

  nav ul {
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
  }

  nav ul li {
    width: 100%;
    text-align: center;
  }

  nav ul li a {
    display: block;
    width: 100%;
    padding: 1rem;
  }
}


/* ===== Container ===== */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 15px;
}

/* ===== Back Link ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--primary);
    transform: translateX(-5px);
}

.back-link i {
    margin-right: 8px;
}

/* ===== Page Header ===== */
.page-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 30px;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.page-header h1 {
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 20px;
    position: relative;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, var(--secondary-color), var(--primary));
    border-radius: 2px;
}

.page-header p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}

/* ===== Books Grid ===== */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

.publication-card {
    background: var(--white);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.publication-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Book Image */
.book-image {
    height: 260px;
    overflow: hidden;
    border-bottom: 1px solid #eee;
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.publication-card:hover .book-image img {
    transform: scale(1.05);
}

/* Book Content */
.publication-content {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.publication-title {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.publication-meta {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.publication-meta span {
    display: flex;
    align-items: center;
}

.publication-meta i {
    margin-right: 6px;
    color: var(--accent);
}

.publication-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* Book Actions */
.publication-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* === GRID LAYOUT === */
.publications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* === CARD STYLE === */
.publication-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.publication-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

/* === IMAGE === */
.publication-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

/* === DETAILS === */
.publication-details {
  padding: 1rem 1.2rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.publication-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.3rem;
}

.publication-year {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-bottom: 0.8rem;
  display: block;
}

/* === DESCRIPTION === */
.publication-description {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.5;
  margin-bottom: 0.6rem;
}

.see-more {
  color: #3498db;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0.8rem;
  display: inline-block;
  transition: color 0.2s;
}

.see-more:hover {
  color: #1d6fa5;
}

/* === LINK === */
.publication-link {
  margin-top: auto;
  align-self: flex-start;
  padding: 0.6rem 1rem;
  background: #3498db;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

.publication-link i {
  margin-right: 6px;
}

.publication-link:hover {
  background: #217dbb;
}


.btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn i {
    margin-right: 6px;
}

.btn-primary {
    background: linear-gradient(to right, var(--accent), #7d3c98);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(to right, #7d3c98, #6c3483);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(142, 68, 173, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.btn-amazon {
    background: linear-gradient(to right, var(--amazon), #ff7700);
    color: white;
}

.btn-amazon:hover {
    background: linear-gradient(to right, #ff7700, #e65c00);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 153, 0, 0.3);
}

/* ===== Footer ===== */
footer {
    background: var(--primary);
    color: white;
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 0 15px;
}

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #ecf0f1;
}

.footer-section p {
    line-height: 1.6;
    color: #bdc3c7;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-links a:hover {
    color: white;
}

.footer-links i {
    margin-right: 8px;
    width: 20px;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    nav {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        background: var(--white);
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    nav.active {
        left: 0;
    }
    
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .page-header h1 {
        font-size: 2.2rem;
    }
    
    .publications-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links a {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .page-header {
        padding: 20px;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .publication-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .book-image {
        height: 200px;
    }
}
