@import 'animations.css';
@import 'admin-ui.css';

:root {
  --primary: #3b82f6;
  --primary-dark: #1e40af;
  --secondary: #1e293b;
  --text-main: #334155;
  --text-light: #64748b;
  --bg-light: #f8fafc;
  --white: #ffffff;
  --border-radius: 12px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --font-main: 'Inter', sans-serif;
  --nav-height: 110px;
  --top-bar-height: 40px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  color: var(--text-main);
  line-height: 1.6;
  background-color: var(--white);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Top Bar */
.top-bar {
  background-color: var(--secondary);
  color: var(--white);
  height: var(--top-bar-height);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 5%;
  font-size: 0.9rem;
  font-weight: 500;
}

.top-bar span {
  margin-left: 25px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar i {
  color: var(--primary);
}

/* Main Navigation */
.main-nav {
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

.nav-logo h2 {
  font-size: 1.8rem;
  letter-spacing: -0.5px;
}

.nav-logo img {
  height: 90px;
  width: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-menu ul {
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-weight: 600;
  font-size: 1rem;
  color: var(--secondary);
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s;
}

.nav-link:hover::after {
  width: 100%;
}

/* Dropdown Styles for Desktop */
.nav-item-dropdown {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--white);
  min-width: 220px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-radius: 0 0 8px 8px;
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 100;
  border: 1px solid #f1f5f9;
}

.nav-item-dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-link-sub {
  display: block;
  padding: 10px 20px;
  color: var(--secondary);
  font-size: 0.95rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link-sub:hover {
  background-color: #f8fafc;
  color: var(--primary);
  padding-left: 25px;
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.hamburger-menu span {
  width: 30px;
  height: 3px;
  background-color: var(--secondary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* Slider Section */
.slider-section {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.slider-container {
  width: 100%;
  position: relative;
}

.slider {
  display: grid;
  grid-template-areas: "stack";
  width: 100%;
}

.slide {
  grid-area: stack;
  position: relative;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.slide.active {
  opacity: 1;
}

.slide::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
  z-index: 1;
}

.slide img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 !important;
  padding: 0 !important;
}

.slider-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  padding: 0 30px;
  z-index: 10;
}

.slider-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.slider-btn:hover {
  background: var(--white);
  color: var(--secondary);
}

/* Latest Projects Section */
.latest-projects-section {
  padding: 80px 5%;
  background: var(--bg-light);
}

.latest-projects-section h2 {
  display: flex;
  align-items: center;
  font-size: 2.5rem;
  color: var(--secondary);
  margin: 0 auto 50px;
  font-weight: 800;
  max-width: 1200px;
  text-align: left;
}

.latest-projects-section h2::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background-color: #cbd5e1;
  margin-left: 30px;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.project-card {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
  width: 270px;
  text-align: left;
  transition: all 0.3s ease;
  border: 1px solid #f1f5f9;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15);
  border-color: #e2e8f0;
}

.project-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background-color: var(--white);
  border-bottom: 1px solid #f1f5f9;
}

.project-card h3 {
  padding: 25px 20px;
  font-size: 1.15rem;
  color: var(--secondary);
  line-height: 1.5;
  background: var(--white);
  margin: 0;
}

/* Info Section (Who We Are) */
.info-section {
  padding: 100px 5%;
  background: var(--white);
}

.info-container {
  display: flex;
  align-items: center;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.info-text {
  flex: 1;
}

.info-image {
  flex: 1;
}

.info-image img {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
}

.info-text h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--secondary);
  font-weight: 800;
}

.btn {
  display: inline-block;
  background-color: var(--primary);
  color: var(--white);
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

/* Hero Banner */
.hero-banner {
  height: 500px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.hero-banner-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 20px;
}

.hero-banner-content h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-banner-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Articles Section */
.articles-section {
  padding: 80px 5%;
  background: var(--white);
}

.articles-section h2 {
  font-size: 2.5rem;
  color: var(--secondary);
  margin-bottom: 50px;
  text-align: center;
  font-weight: 800;
}

.articles-section h2::after {
  content: '';
  display: block;
  width: 100px;
  height: 4px;
  background: var(--primary);
  margin: 15px auto 0;
  border-radius: 2px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.article-card {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s;
  border: 1px solid #e2e8f0;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.article-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.article-content {
  padding: 1.5rem;
}

.article-content h3 {
  font-size: 1.25rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.article-content p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.read-more {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Videos Section */
.videos-section {
  padding: 80px 5%;
  background: var(--bg-light);
}

.videos-section h2 {
  font-size: 2.5rem;
  color: var(--secondary);
  margin-bottom: 50px;
  text-align: center;
  font-weight: 800;
}

.videos-section h2::after {
  content: '';
  display: block;
  width: 100px;
  height: 4px;
  background: var(--primary);
  margin: 15px auto 0;
  border-radius: 2px;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.video-card {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-info {
  padding: 20px;
  text-align: center;
}

.video-info h3 {
  font-size: 1.1rem;
  color: var(--secondary);
}

/* Footer */
.main-footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 60px 0 30px;
}

.footer-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 10px;
  width: 92%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

.footer-col {
  text-align: center;
}

.footer-col img {
  margin: 0 auto;
}

.footer-col h4 {
  color: var(--white);
  font-size: 1.2rem;
  margin-bottom: 25px;
  font-weight: 700;
}

.footer-about p {
  font-size: 0.95rem;
  line-height: 1.8;
}

.footer-contact-list li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  gap: 15px;
  justify-content: center;
}

.footer-contact-list i {
  color: var(--primary);
  margin-top: 5px;
}

.footer-links-list li {
  margin-bottom: 12px;
}

.footer-links-list a:hover {
  color: var(--primary);
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid #1e293b;
  font-size: 0.9rem;
}

.footer-social-links {
  margin-bottom: 20px;
}

.footer-social-links a {
  display: inline-block;
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  line-height: 45px;
  border-radius: 50%;
  margin: 0 10px;
  font-size: 1.3rem;
  transition: all 0.3s;
}

.footer-social-links a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

/* Generic Page Styles */
.main-content {
  padding: 110px 5% 60px;
  margin: 0 auto;
  min-height: 80vh;
}

.feria-features {
    list-style: none;
    margin-top: 20px;
}
.feria-features li {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--text-main);
}

/* Admin Panel Styles */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: #1e293b;
  color: #fff;
  padding: 20px 0;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar h2 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 30px;
  color: #fff;
  border-bottom: 1px solid #334155;
  padding-bottom: 20px;
}

.sidebar ul {
  padding: 0 20px;
}

.sidebar li {
  margin-bottom: 15px;
}

.sidebar a {
  display: block;
  color: var(--white);
  padding: 10px;
  border-radius: 6px;
  transition: all 0.2s;
}

.sidebar a:hover {
  background-color: #334155;
  color: #fff;
  padding-left: 15px;
}

.admin-main {
  flex-grow: 1;
  background-color: #f1f5f9;
  padding: 40px;
  overflow-y: auto;
}

/* Admin Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 30px;
  border: 1px solid #e2e8f0;
  width: 90%;
  max-width: 600px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.close {
  color: #94a3b8;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover,
.close:focus {
  color: #1e293b;
  text-decoration: none;
}

.btn-edit {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-edit:hover {
  background-color: #2563eb;
}

.btn-delete {
  background-color: #ef4444;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-delete:hover {
  background-color: #dc2626;
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  
  .admin-main {
    padding: 20px;
  }
}
@media (max-width: 968px) {
  :root {
      --nav-height: 70px;
  }

  .hamburger-menu {
    display: flex;
    position: relative;
    z-index: 2001;
  }

  .nav-menu {
    position: fixed;
    z-index: 2000;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 100px 20px 40px;
    gap: 20px;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
  }

  .nav-menu.active {
    right: 0;
  }

  /* Hamburger Animation */
  .hamburger-menu.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  .nav-item-dropdown {
    width: 100%;
    display: block;
    height: auto;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 12px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #f1f5f9;
  }

  .dropdown-content {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: 15px;
    display: none;
    background: #f8fafc;
    width: 100%;
    box-sizing: border-box;
  }

  .nav-item-dropdown.active .dropdown-content {
    display: block;
  }

  .nav-link::after {
    display: none;
  }
  
  .top-bar {
      padding: 0 20px;
      justify-content: space-between;
      height: auto;
      min-height: 40px;
      flex-wrap: wrap;
      font-size: 0.8rem;
  }
  
  .top-bar span {
      margin: 5px 10px;
  }
  
  .info-container {
    flex-direction: column;
    text-align: center;
  }
  
  .info-section.alternate .info-container {
      flex-direction: column-reverse;
  }

  .hero-banner-content h1 {
      font-size: 2.2rem;
  }
  
  .info-text h2 {
      font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .latest-projects-section h2 {
    font-size: 2rem;
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .latest-projects-section h2::after {
    width: 100px;
    margin: 0 auto;
    flex-grow: 0;
  }

  .articles-section h2 {
    font-size: 2rem;
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .articles-section h2::after {
    width: 100px;
    margin: 0 auto;
    flex-grow: 0;
  }

  .videos-section h2 {
    font-size: 2rem;
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .videos-section h2::after {
    width: 100px;
    margin: 0 auto;
    flex-grow: 0;
  }

  .hero-banner {
    height: 400px;
  }
  
  /* Slider Mobile Adjustments */
  .slider-controls {
    padding: 0 10px;
  }
  
  .slider-btn {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
  
  .projects-grid {
      gap: 20px;
  }
  
  .project-card {
      width: 100%;
      max-width: 400px;
  }

  .article-card {
      width: 100%;
      max-width: 400px;
  }

  .videos-grid {
      grid-template-columns: 1fr;
      gap: 30px;
  }
  
  .footer-container {
      grid-template-columns: 1fr;
      gap: 30px;
  }

  /* Top Bar Responsive Adjustments - User Request */
  .top-bar {
    justify-content: center;
    flex-direction: column;
    padding: 0.5rem 0;
    height: auto;
    gap: 0.25rem;
  }
  
  .top-bar span {
    margin: 0;
    justify-content: center;
    width: 100%;
  }

  /* Adjust Menu Padding for Taller Header */
  .nav-menu {
    padding-top: 150px;
  }
}

/* Content Module Responsive */
@media (max-width: 768px) {
  .module-text-image {
    flex-direction: column !important;
    gap: 2rem !important;
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
  }
  
  .module-text-image > div {
    width: 100% !important;
    text-align: center !important; 
  }

  .module-text-image img {
    max-width: 100% !important;
    height: auto !important;
  }
}
