/* PREMIUM THEME: Deep Space & Gold */
:root {
  /* Palette */
  --bg-primary: #0f172a; /* Slate 900 */
  --bg-secondary: #1e293b; /* Slate 800 */
  --bg-glass: rgba(30, 41, 59, 0.7);

  --text-primary: #f8fafc; /* Slate 50 */
  --text-secondary: #94a3b8; /* Slate 400 */

  --accent-gold: #fbbf24; /* Amber 400 */
  --accent-gold-hover: #f59e0b; /* Amber 500 */

  --accent-blue: #38bdf8; /* Sky 400 */
  --accent-purple: #818cf8; /* Indigo 400 */

  --success: #34d399;
  --danger: #f87171;

  /* Spacing & Layout */
  --container-width: 1200px;
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 8px;

  /* Shadows */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.15);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Outfit", "Segoe UI", sans-serif; /* Fallback to Segoe UI if Outfit not loaded */
  line-height: 1.6;
  overflow-x: hidden;
  /* Subtle background texture/gradient */
  background-image: radial-gradient(
      circle at 10% 20%,
      rgba(56, 189, 248, 0.1) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(129, 140, 248, 0.1) 0%,
      transparent 40%
    );
  background-attachment: fixed;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}

/* Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.text-gold {
  color: var(--accent-gold);
}
.text-blue {
  color: var(--accent-blue);
}

/* Components: Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  border-radius: var(--border-radius-md);
  transition: var(--transition-fast);
  cursor: pointer;
  font-size: 1rem;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  backdrop-filter: blur(4px);
}

.btn-outline:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.05);
}

.btn-gold {
  background: var(--accent-gold);
  color: var(--bg-primary);
}
.btn-gold:hover {
  background: var(--accent-gold-hover);
  transform: translateY(-2px);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 1rem;
  z-index: 1000;
  margin: 0 auto 2rem auto;
  width: 95%; /* Float effect */
  max-width: var(--container-width);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-lg);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-span {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.navlist {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.navlink {
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0;
}

.navlink::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-blue);
  transition: var(--transition-fast);
}

.navlink:hover {
  color: var(--text-primary);
}

.navlink:hover::after {
  width: 100%;
}

/* Hero */
.hero-section {
  position: relative;
  padding: 6rem 0;
  text-align: center;
  overflow: hidden;
}

/* Animated background elements could go here */

.hero-content {
  position: relative;
  z-index: 10;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 30%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 3rem auto;
}

/* Books Grid */
.books-section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 4rem;
}

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

.book-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(56, 189, 248, 0.3);
}

.book-cover {
  height: 280px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.8), transparent);
}

.book-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.book-author {
  color: var(--accent-blue);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.book-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex: 1; /* Pushes actions down */
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.book-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
}

.price-tag {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(
    --accent-gold
  ); /* Fixes the yellow color issue request by making it gold/consistent */
}

/* Detail Page */
.detail-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 4rem;
  padding: 4rem 0;
}

.detail-cover {
  width: 100%;
  border-radius: var(--border-radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-info h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.detail-info .author {
  font-size: 1.25rem;
  color: var(--accent-blue);
  margin-bottom: 2rem;
}

.detail-info .price {
  font-size: 2rem;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 2rem;
}

.detail-description {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 3rem;
  line-height: 1.8;
}

.detail-buttons {
  display: flex;
  gap: 1rem;
}

/* Cart & Checkout */
.cart-page,
.checkout-page {
  padding: 4rem 0;
  max-width: 800px;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1.5rem;
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  margin-bottom: 1rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.cart-total {
  margin-top: 2rem;
  text-align: right;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.cart-total span {
  color: var(--accent-gold);
  font-weight: 800;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(0, 0, 0, 0.4);
}

/* Clients */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 2rem;
    align-items: center;
    justify-items: center;
    margin-top: 2rem;
}

.client-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    width: 100%;
    display: flex;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition-fast);
}

.client-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-4px);
}

/* Footer */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 3rem 0;
  text-align: center;
  color: var(--text-secondary);
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2.5rem;
  }
  .navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .navlist {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
  .cart-item {
    grid-template-columns: 60px 1fr;
  }
}

/* Modal / Popup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    place-items: center; /* Centering for grid */
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem; /* Prevent edge touching on mobile */
}

.modal-overlay.active {
    display: grid; /* Use grid for easy centering */
    opacity: 1;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 500px;
    width: 100%; /* Full width up to max-width */
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1.5rem;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 2rem 1.5rem;
    }
    .modal-actions {
        flex-direction: column;
    }
    .modal-actions .btn {
        width: 100%;
    }
}
