/* Global Styles */
:root {
  --bg-color: #feebf1; /* Light Pink */
  --text-color: #283131; /* Dark Slate - Good contrast */
  --secondary-text: #5a6a6a; /* Softer secondary */
  --primary-brand: #5f084b; /* Deep Plum - Primary Actions/Brand */
  --accent-color: #fe9bba; /* Soft Pink - Highlights */

  --card-bg: #ffffff;
  --modal-bg: #ffffff;

  /* Spacing Variables */
  --section-spacing: 60px;
  --container-padding: 5%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
  line-height: 1.6; /* Better readability */
}

h1,
h2,
h3,
.logo {
  font-family: "Playfair Display", serif;
  color: var(--primary-brand); /* consistent brand color */
}

/* Header */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
  padding: 15px 0;
}

.header.scrolled {
  background-color: rgba(254, 235, 241, 0.95); /* Semi-transparent Brand BG */
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(95, 8, 75, 0.05);
  padding: 10px 0; /* Shrink slightly */
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--container-padding);
}

.logo img {
  height: 48px;
  width: auto;
  transition: height 0.3s;
}

.header.scrolled .logo img {
  height: 40px; /* Resize logo on scroll */
}

/* User Menu & Dropdown */
.user-menu-container {
  position: relative;
}

.user-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-brand);
  padding: 8px;
  border-radius: 50%;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-icon-btn:hover {
  background: rgba(95, 8, 75, 0.05);
}

.icon-user {
  width: 32px;
  height: 32px;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 8px;
  min-width: 150px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: all 0.2s ease;
  z-index: 1001;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.dropdown-menu.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  display: block !important; /* Override generic hidden */
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  color: #d32f2f; /* Red for logout */
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: background 0.2s;
  font-weight: 600;
}

.dropdown-item:hover {
  background: #fff5f5;
}

.icon-logout {
  width: 18px;
  height: 18px;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 85vh; /* Taller hero */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 var(--container-padding);
  background: transparent;
  overflow: hidden;
}

/* Background Gradients - Softer/Cleaner */
.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 80%;
  height: 80%;
  background: radial-gradient(
    circle,
    rgba(254, 155, 186, 0.15) 0%,
    transparent 70%
  );
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(
    circle,
    rgba(95, 8, 75, 0.08) 0%,
    transparent 70%
  );
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}

.hero-overlay {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
  margin-top: 80px; /* Offset for header */
}

/* Responsive Typography */
.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.5rem); /* Responsive Fluid Text */
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
  color: var(--primary-brand); /* Solid color is more premium/legible */
  letter-spacing: -0.02em;
  background: none; /* Removed gradient text */
  -webkit-text-fill-color: initial;
}

.hero-description {
  font-family: "Comic Neue", cursive;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.6;
  margin-bottom: 40px;
  color: var(--secondary-text);
  font-weight: 400; /* Lighter weight for elegance */
  max-width: 90%;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap; /* Safety for small screens */
}

/* Premium Buttons */
.btn {
  border: none;
  border-radius: 50px; /* Pill shape is more modern */
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-decoration: none;
  font-family: "Inter", sans-serif;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Subtle shadow */
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--primary-brand);
  color: #fff;
}

.btn-primary:hover {
  background-color: #4a063a; /* Darker shade */
  box-shadow: 0 8px 25px rgba(95, 8, 75, 0.25);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-brand);
  border: 2px solid var(--primary-brand); /* Thicker border */
}

.btn-secondary:hover {
  background-color: rgba(95, 8, 75, 0.05);
  transform: translateY(-2px);
}

.icon {
  width: 24px;
  height: 24px;
}

/* Content Layout */
.content-container {
  position: relative;
  z-index: 10;
  padding-bottom: 100px;
  padding-top: 120px; /* Offset for fixed header since Hero is removed */
}

.row-section {
  margin-bottom: var(--section-spacing);
  padding: 0 var(--container-padding);
}

.row-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--primary-brand);
  margin-bottom: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
}

/* Decorative line next to title */
.row-title::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--accent-color);
  flex: 1;
  margin-left: 20px;
  opacity: 0.5;
}

.row-container {
  position: relative;
  /* Scroll Snap implementation for cleaner slide */
  scroll-snap-type: x mandatory;
}

.row {
  display: flex;
  gap: 24px; /* More breathing room */
  overflow-x: auto;
  padding: 20px 5px; /* Padding for shadow clipping */
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch; /* Momentum scroll iOS */
}

.row::-webkit-scrollbar {
  display: none;
}

/* Hide Handles on touch devices or by default, add via hover only on desktop */
.handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #eee;
  color: var(--primary-brand);
  font-size: 1.5rem;
  z-index: 20;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.row-container:hover .handle {
  opacity: 1;
}

.left-handle {
  left: -20px;
}
.right-handle {
  right: -20px;
}

/* Desktop Hover Only handles */
@media (max-width: 768px) {
  .handle {
    display: none !important;
  } /* Clean mobile look */
}

/* Card Styling */
.card {
  flex: 0 0 auto;
  width: 240px;
  height: 345px;
  background-color: var(--card-bg);
  border-radius: 16px; /* Enhanced rounding */
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(40, 49, 49, 0.08); /* Premium Shadow */
  scroll-snap-align: start; /* Snap alignment */
  border: 1px solid rgba(255, 255, 255, 0.5); /* Subtle border */
}

.card:hover {
  transform: translateY(-10px) scale(1.02); /* Lift effect instead of just scale */
  box-shadow: 0 20px 40px rgba(95, 8, 75, 0.15);
  border-color: var(--accent-color);
}

.card-visual {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-visual {
  transform: scale(1.05); /* Zoom image inside card */
}

/* Image Mappings */
.visual-xtiles {
  background-image: url("assets/images/main_2.jpg");
}
.visual-notion {
  background-image: url("assets/images/main_1.jpg");
}
.visual-manual {
  background-image: url("assets/images/main_4.jpg");
}
.visual-desafio {
  background-image: url("assets/images/main_3.jpg");
}
.visual-guia {
  background-image: url("assets/images/main_5.jpg");
}

.visual-smart {
  background-image: url("assets/images/indicacao_1.jpg");
}
.visual-pomodoro {
  background-image: url("assets/images/indicacao_2.jpg");
}
.visual-app {
  background-image: url("assets/images/indicacao_3.jpg");
}
.visual-screen {
  background-image: url("assets/images/indicacao_4.jpg");
}

.visual-drive {
  background-image: url("assets/images/books_1.jpg");
}
.visual-ebook {
  background-image: url("assets/images/books_2.jpg");
}

/* Bonus Visuals */
.visual-bonus-1 {
  background-image: url("assets/images/bonus_1.jpg");
}
.visual-bonus-2 {
  background-image: url("assets/images/bonus_2.jpg");
}
.visual-bonus-3 {
  background-image: url("assets/images/bonus_3.jpg");
}
.visual-bonus-4 {
  background-image: url("assets/images/bonus_4.jpg");
}
.visual-bonus-5 {
  background-image: url("assets/images/bonus_5.jpg");
}

/* Footer */
.footer {
  padding: 80px var(--container-padding);
  color: var(--secondary-text);
  font-size: 1rem;
  text-align: center;
  font-family: "Comic Neue", cursive;
  opacity: 0.8;
}

/* Modal */
.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(95, 8, 75, 0.2); /* Brand tinted overlay */
  backdrop-filter: blur(12px); /* Strong glass effect */
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

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

.modal-container {
  background-color: var(--modal-bg);
  width: 90%;
  max-width: 900px;
  height: 85vh;
  border-radius: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); /* Deep shadow */
  animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  color: var(--text-color);
  overflow: hidden; /* Ensure rounded corners clip content */
}

@keyframes scaleUp {
  from {
    transform: scale(0.95) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 50%;
  border: 1px solid #eee;
  color: var(--primary-brand);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  transform: rotate(90deg) scale(1.1);
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.modal-close-btn svg {
  pointer-events: none;
  width: 24px;
  height: 24px;
}

.modal-header {
  padding: 30px 40px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(to right, #ffffff, #fafafa);
}

.modal-header h2 {
  font-size: 2.2rem; /* Larger, cleaner */
  margin-bottom: 12px;
  color: var(--primary-brand);
}

.modal-header p {
  color: var(--secondary-text);
  line-height: 1.6;
  font-size: 1.1rem;
  font-family: "Inter", sans-serif;
}

.modal-body {
  flex: 1;
  background: #f8f9fa; /* Slight contrast for content area */
  position: relative;
}

.pdf-container {
  width: 100%;
  height: 100%;
}

.pdf-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-footer {
  padding: 20px 40px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: #fff;
  display: flex;
  justify-content: flex-end;
}

/* Mobile Responsiveness & Drawer */
@media (max-width: 768px) {
  :root {
    --container-padding: 6%; /* Slightly more side padding on mobile */
  }

  .hero {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 60px;
    text-align: center; /* Center align hero on mobile often looks better */
    justify-content: center;
  }

  .hero::before,
  .hero::after {
    filter: blur(40px);
    opacity: 0.6;
  }

  .hero-content {
    margin-top: 20px;
    align-items: center;
    display: flex;
    flex-direction: column;
  }

  .hero-buttons {
    justify-content: center;
    width: 100%;
  }

  .btn {
    width: 100%; /* Full width buttons on mobile */
    justify-content: center;
  }

  .row-title::after {
    display: none; /* Remove decorative line on mobile if space is tight */
  }

  .card {
    /* Mobile Dimensions: 140x201 (Ratio ~0.7) */
    width: 150px; /* Slightly larger targets */
    height: 215px;
    flex-shrink: 0;
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .modal-container {
    width: 100%;
    max-width: 100%;
    height: 85vh; /* Drawer height */
    border-radius: 24px 24px 0 0; /* Only top rounded */
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .modal-header {
    padding: 25px 20px;
  }

  .modal-header h2 {
    font-size: 1.6rem;
  }
  /* Login Overlay */
  body.hidden-overflow {
    overflow: hidden;
  }

  .login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(254, 235, 241, 0.98); /* Brand BG opaque */
    backdrop-filter: blur(15px);
    z-index: 3000;
    display: flex;
    flex-direction: column; /* Stack card and hint */
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s;
  }

  .login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .login-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(95, 8, 75, 0.15);
    width: 90%;
    max-width: 400px;
    text-align: center;
    animation: scaleUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .login-password-hint {
    margin-top: 24px;
    color: var(--primary-brand);
    font-size: 1rem;
    text-align: center;
    opacity: 0;
    animation: fadeIn 0.5s ease 0.3s forwards; /* Fade in slightly after card */
  }

  .login-logo img {
    height: 60px;
    margin-bottom: 20px;
  }

  .login-container h2 {
    font-size: 1.8rem;
    color: var(--primary-brand);
    margin-bottom: 10px;
  }

  .login-instruction {
    color: var(--secondary-text);
    margin-bottom: 30px;
    font-size: 0.95rem;
  }

  .input-group {
    margin-bottom: 20px;
    position: relative;
  }

  .input-group input {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid #eee;
    border-radius: 50px;
    font-family: "Inter", sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
    background: #fafafa;
  }

  .input-group input:focus {
    border-color: var(--primary-brand);
    background: #fff;
  }

  .password-group {
    display: flex;
    align-items: center;
  }

  .toggle-password {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary-text);
    display: flex;
    align-items: center;
  }

  .icon-eye {
    width: 20px;
    height: 20px;
  }

  .btn-full {
    width: 100%;
    justify-content: center;
    font-size: 1.1rem;
    padding: 12px;
  }

  .login-error {
    color: #d32f2f;
    background: #ffebee;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: none;
  }

  .login-error.visible {
    display: block;
  }

  .modal-close-btn {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
  }

  @keyframes slideUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  /* Compact Drawer Mode (Links) */
  .modal-container.modal-compact {
    height: auto !important; /* Override fixed height */
    min-height: 250px;
    padding-bottom: 30px; /* Safe area */
  }
}

/* Compact Modal Desktop */
.modal-container.modal-compact {
  height: auto;
  min-height: 200px;
}
