/* Custom Styles for Reddemo AI Website */

/* Base styles for all devices */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  backdrop-filter: blur(10px);
  height: 80px;
}

header .container {
  height: 100%;
  display: flex;
  align-items: center;
}

header img {
  transition: transform 0.3s ease;
}

header img:hover {
  transform: scale(1.05);
}

.nav-bar-fixed {
  position: fixed;
  top: 80px;
  width: 100%;
  z-index: 50;
  background-color: #1f2937;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 8px;
  z-index: 70;
  position: relative;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: #333;
  margin: 2px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

.desktop-nav {
  display: flex;
}

.desktop-nav-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 1rem;
  gap: 2rem;
}

.desktop-nav-bar .dropdown {
  position: relative;
  display: inline-block;
}

.desktop-nav-bar .dropdown:hover .dropdown-content {
  display: block;
}

.nav-toggle {
  display: none;
  background: #374151;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  right: 16px;
  left: auto;
  background: #f0f0e6;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-radius: 0 0 8px 8px;
  min-width: 200px;
  z-index: 85;
  margin-top: 1px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.mobile-menu.active,
.mobile-menu:not(.hidden) {
  display: block !important;
}

.mobile-menu a {
  display: block;
  padding: 12px 20px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #e5e5e5;
  font-size: 16px !important;
  font-weight: 600;
  cursor: pointer;
}

.mobile-menu a:hover {
  background-color: #e5e5e5;
}

.mobile-menu a:last-child {
  border-bottom: none;
}

/* Mobile menu dropdown specific styles */
.mobile-menu .dropdown {
  position: relative;
}

.mobile-menu .dropdown > a {
  position: relative;
  padding-right: 30px;
}

.mobile-menu .dropdown .dropdown-content {
  display: none;
  position: static;
  background-color: #d8d8ce;
  box-shadow: none;
  width: 100%;
  border-radius: 0;
  margin-top: 0;
  padding: 0;
  min-height: 0;
  overflow: visible;
  z-index: auto;
  max-height: none;
  transform: none;
}

.mobile-menu .dropdown .dropdown-content a {
  padding: 10px 20px 10px 35px;
  font-size: 14px;
  color: #333;
  border-bottom: 1px solid #c5c5b5;
  background-color: #d8d8ce;
}

.mobile-menu .dropdown .dropdown-content a:hover {
  background-color: #c5c5b5;
}

.mobile-menu .dropdown .dropdown-content a:last-child {
  border-bottom: none;
}

.mobile-nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #4a5568;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 55;
  margin-top: 0;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.mobile-nav-dropdown.active {
  display: block;
}

.mobile-nav-dropdown a {
  display: block;
  padding: 12px 20px;
  text-align: center;
  color: white;
  border-bottom: 1px solid #2d3748;
  font-size: 14px;
  cursor: pointer;
}

.mobile-nav-dropdown a:hover {
  background-color: #2d3748;
}

.mobile-nav-dropdown a:last-child {
  border-bottom: none;
}

/* Mobile nav dropdown nested dropdown */
.mobile-nav-dropdown .dropdown {
  position: relative;
}

.mobile-nav-dropdown .dropdown > a {
  position: relative;
  padding-right: 30px;
}

.mobile-nav-dropdown .dropdown .dropdown-content {
  display: none;
  position: static;
  background-color: #374151;
  width: 100%;
  border-radius: 0;
  box-shadow: none;
  z-index: auto;
  margin: 0;
  padding: 0;
}

.mobile-nav-dropdown .dropdown .dropdown-content a {
  padding: 12px 25px;
  text-align: center;
  color: white;
  border-bottom: 1px solid #1f2937;
  background-color: #374151;
  font-size: 13px;
}

.mobile-nav-dropdown .dropdown .dropdown-content a:hover {
  background-color: #1f2937;
}

.mobile-nav-dropdown .dropdown .dropdown-content a:last-child {
  border-bottom: none;
}

/* Platform dropdown styles (top-header) */
.platform-dropdown {
  position: relative;
  display: inline-block;
}

.platform-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #1f2937;
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  z-index: 1100;
  border-radius: 8px;
  overflow: hidden;
}

.platform-dropdown:hover .platform-dropdown-content {
  display: block;
}

.platform-dropdown-content a {
  color: white !important;
  padding: 0.75rem 1rem;
  text-decoration: none;
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.platform-dropdown-content a:hover {
  background-color: #374151;
  text-decoration: none;
}

/* Magazines dropdown styles (nav-bar-fixed) */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  transform: translateX(0);
  background-color: #1f2937;
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  z-index: 55;
  padding: 0;
  text-align: left;
  border-radius: 4px;
  overflow: hidden;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  color: white;
  padding: 0.75rem 1rem;
  text-decoration: none;
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
  background-color: #374151;
}

/* Navigation link styles */
.nav-link {
  color: white;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #93c5fd;
}

.nav-link.active {
  text-decoration: underline;
  color: #60a5fa;
}

nav a {
  transition: color 0.3s ease;
  position: relative;
}

nav a:hover {
  color: #4F46E5;
}

nav a.active-page {
  color: #4F46E5;
  font-weight: bold;
}

nav a.active-page::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #4F46E5;
}

/* Marquee styles */
.marquee-container {
  margin-top: 3.5rem;
  background-color: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 1rem;
  overflow: hidden;
  z-index: 999;
}

.marquee {
  white-space: nowrap;
  animation: marquee 15s linear infinite;
}

.marquee:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Fixed header and nav adjustments */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.fixed-nav {
  position: fixed;
  top: 112px;
  left: 0;
  right: 0;
  z-index: 40;
}

.content-with-fixed-nav {
  padding-top: 172px;
}

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

/* Card and overlay styles */
.card-overlay {
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 70%, rgba(0,0,0,0.9) 100%);
}

.nav-arrow {
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
}

.nav-arrow:hover {
  background: rgba(0,0,0,0.8);
}

.nav-arrow.disabled {
  background: rgba(0,0,0,0.2);
  cursor: not-allowed;
}

.nav-arrow.disabled:hover {
  background: rgba(0,0,0,0.2);
}

/* Loading animation */
.loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Article card hover effects */
.article-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Featured section styling */
.featured-main-card {
  min-height: 400px;
}

.featured-small-card {
  min-height: 180px;
}

/* Category badges */
.category-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.category-ai {
  background-color: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}

.category-ml {
  background-color: rgba(34, 197, 94, 0.1);
  color: #166534;
}

.category-cyber {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.category-custom {
  background-color: rgba(139, 69, 19, 0.1);
  color: #8B4513;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Body padding */
body {
  padding-top: 0;
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
  overflow: hidden;
}

/* Scroll offset for anchor links */
section[id] {
  scroll-margin-top: 120px;
}

/* Page transition */
.page-transition {
  transition: opacity 0.3s ease-in-out;
}

/* Loading and error states */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 16px;
}

.loading-text {
  color: #6b7280;
  font-size: 14px;
}

.error-container {
  background-color: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.error-text {
  color: #dc2626;
  margin-bottom: 8px;
}

.retry-button {
  background-color: #3b82f6;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.retry-button:hover {
  background-color: #2563eb;
}

/* Slider styles */
.slider-container {
  position: relative;
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0;
  left: 100%;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: all 0.8s ease-in-out;
}

.slide.active {
  left: 0;
  opacity: 1;
}

.slide.prev {
  left: -100%;
  opacity: 0;
}

/* Article detail page styles */
#articleDetailPage {
  position: relative;
  z-index: 30;
  background-color: #f9fafb;
  min-height: 100vh;
  padding-top: 0;
}

#articleDetailPage .article-content-wrapper {
  padding-top: 7rem;
}

#articleDetailPage .article-clean-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

#articleDetailPage .featured-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  max-height: 400px;
  border-radius: 8px;
  display: block;
}

#articleDetailPage .max-w-5xl {
  max-width: 80rem !important;
}

/* Article typography */
.prose {
  color: #374151;
  line-height: 1.8;
  font-size: 16px;
  position: relative;
  z-index: 1;
  background: white;
  padding: 0;
  margin: 0;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.prose h1 {
  color: #111827;
  font-weight: 800;
  font-size: 2.5rem;
  margin: 2rem 0 1rem 0;
  line-height: 1.2;
}

.prose h2 {
  color: #111827;
  font-weight: 700;
  font-size: 2rem;
  margin: 2rem 0 1rem 0;
  line-height: 1.3;
}

.prose h3 {
  color: #111827;
  font-weight: 600;
  font-size: 1.5rem;
  margin: 1.5rem 0 0.75rem 0;
}

.prose p {
  margin-bottom: 1.5rem;
  text-align: justify;
}

.prose ul, .prose ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.prose li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.prose strong {
  font-weight: 600;
  color: #111827;
}

.prose a {
  color: #3B82F6;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.prose a:hover {
  color: #1D4ED8;
}

/* Blog content wrapper */
.blog-content-wrapper {
  all: unset !important;
}

.blog-content-wrapper * {
  word-wrap: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  max-width: none !important;
  overflow: visible !important;
}

/* Magazines page */
#magazinesPage img {
  transition: transform 0.3s ease;
}

#magazinesPage img:hover {
  transform: scale(1.05);
}

button.bg-gray-200:hover {
  background-color: #e5e7eb;
}

/* Desktop styles (1025px and above) */
@media (min-width: 1025px) {
  .hamburger {
    display: none;
  }
  .nav-toggle {
    display: none;
  }
  #magazineGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tablet styles (769px to 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
  header {
    height: 75px;
    padding: 8px 20px;
  }
  header img {
    height: 55px;
  }
  .nav-bar-fixed {
    top: 75px;
    height: 45px;
  }
  .desktop-nav {
    display: none !important;
  }
  .hamburger {
    display: flex !important;
  }
  .desktop-nav-bar {
    display: none;
  }
  .nav-toggle {
    display: block;
    padding: 10px 18px;
    font-size: 13px;
  }
  .content-padding {
    padding-top: 125px !important;
  }
  #articleDetailPage .article-content-wrapper {
    padding-top: 6.5rem;
  }
  #articleDetailPage .max-w-5xl {
    max-width: 90% !important;
  }
  #articleDetailPage .featured-image {
    max-height: 300px;
  }
  #magazineGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .desktop-nav-bar {
    gap: 1.5rem;
  }
  .mobile-menu {
    right: 20px;
    top: calc(100% + 5px);
    z-index: 90;
    max-width: 300px;
  }
  .mobile-nav-dropdown {
    top: calc(100% + 2px);
    z-index: 60;
  }
}

/* Mobile styles (768px and below) */
@media (max-width: 768px) {
  header {
    height: 65px;
    padding: 8px 16px;
  }
  header .container {
    position: relative;
    width: 100%;
    justify-content: space-between;
  }
  header img {
    height: 50px;
  }
  .nav-bar-fixed {
    top: 65px;
    height: 40px;
    padding: 8px 16px;
  }
  .desktop-nav {
    display: none !important;
  }
  .hamburger {
    display: flex !important;
    padding: 6px;
    position: relative;
    z-index: 90;
  }
  .hamburger span {
    width: 22px;
    height: 2px;
  }
  .desktop-nav-bar {
    display: none !important;
  }
  .nav-toggle {
    display: block;
    padding: 8px 16px;
    font-size: 12px;
    z-index: 60;
  }
  .mobile-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 16px;
    left: auto;
    width: 250px;
    max-width: calc(100vw - 32px);
    z-index: 85;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  }
  .content-padding {
    padding-top: 110px !important;
  }
  .marquee-container {
    margin-top: 65px;
    padding: 8px 0;
  }
  #contact {
    padding-top: 4rem;
  }
  .mobile-menu .dropdown {
    position: relative;
  }
  .mobile-menu .dropdown .dropdown-content {
    display: none;
    position: static;
    background-color: #e5e5e5;
    box-shadow: none;
    width: 100%;
    border-radius: 0;
    margin-top: 0;
    padding: 0;
    min-height: 0;
    overflow: visible;
    z-index: auto;
  }
  .mobile-menu .dropdown .dropdown-content a {
    padding: 8px 20px 8px 30px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #d5d5d5;
  }
  .mobile-menu .dropdown .dropdown-content a:hover {
    background-color: #d5d5d5;
  }
  .mobile-menu .dropdown .dropdown-content:not(.hidden) {
    display: block !important;
  }
  .platform-dropdown-content {
    position: static !important;
    background-color: #e5e5e5 !important;
    box-shadow: none !important;
    width: 100% !important;
    border-radius: 0 !important;
    z-index: auto !important;
    transform: none !important;
  }
  .platform-dropdown-content a {
    color: #333 !important;
    padding: 8px 20px 8px 30px !important;
    font-size: 14px !important;
    border-bottom: 1px solid #d5d5d5 !important;
  }
  .platform-dropdown-content a:hover {
    background-color: #d5d5d5 !important;
  }
  .mobile-nav-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 60;
  }
  .mobile-nav-dropdown .dropdown-content {
    position: static;
    background-color: #4a5568;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    z-index: auto;
  }
  .mobile-nav-dropdown .dropdown-content a {
    padding: 12px 20px;
    text-align: center;
    color: white;
    border-bottom: 1px solid #2d3748;
  }
  .nav-arrow {
    width: 35px;
    height: 35px;
  }
  .grid-cols-1.md\\:grid-cols-3 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .fixed-nav {
    top: 100px;
  }
  .content-with-fixed-nav {
    padding-top: 160px;
  }
  #articleDetailPage .article-content-wrapper {
    padding-top: 6rem;
  }
  #articleDetailPage .max-w-5xl {
    max-width: 95% !important;
  }
  #articleDetailPage .featured-image {
    max-height: 250px;
  }
  #getFeaturedPage .article-content-wrapper {
    padding-top: 11rem;
  }
  #platformPages .pt-20 {
    padding-top: 11rem !important;
  }
}

/* Small mobile styles (640px and below) */
@media (max-width: 640px) {
  header {
    height: 55px;
    padding: 6px 12px;
  }
  header img {
    height: 40px;
  }
  .nav-bar-fixed {
    top: 55px;
    height: 35px;
    padding: 6px 12px;
  }
  .hamburger {
    padding: 4px;
  }
  .hamburger span {
    width: 20px;
    height: 2px;
  }
  .nav-toggle { 
    display: block;
    font-size: 11px;
    padding: 6px 12px;
  }
  .mobile-menu {
    right: 12px;
    width: 220px;
    max-width: calc(100vw - 24px);
  }
  .content-padding {
    padding-top: 95px !important;
  }
  .marquee-container {
    margin-top: 55px;
  }
  #contact {
    padding-top: 3.5rem;
  }
  .article-title {
    font-size: 1rem;
    line-height: 1.4;
  }
  .article-date {
    font-size: 0.75rem;
  }
  .fixed-nav {
    top: 90px;
  }
  .content-with-fixed-nav {
    padding-top: 150px;
  }
  #articleDetailPage .article-content-wrapper {
    padding-top: 10rem;
  }
  #articleDetailPage .max-w-5xl {
    max-width: 95% !important;
  }
  #articleDetailPage .featured-image {
    max-height: 200px;
  }
  #getFeaturedPage .article-content-wrapper {
    padding-top: 10rem;
  }
  #platformPages .pt-20 {
    padding-top: 10rem !important;
  }
  .desktop-nav-bar {
    display: none;
  }
  .mobile-nav-dropdown {
    display: block;
  }
  #magazineGrid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  #magazineGrid { 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
  }
  .desktop-nav-bar { 
    gap: 1.5rem; 
  }
}