@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #005A9C; /* Deep Aegean Blue */
  --primary-light: #0088CC;
  --secondary: #E6F3FA;
  --accent: #F4A261;
  --text-dark: #1F2937;
  --text-light: #6B7280;
  --bg-color: #FAFAFA;
  --white: #FFFFFF;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

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

ul {
  list-style: none;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-dark);
  transition: var(--transition);
  padding: 0.5rem 0;
}

.nav-links a:hover {
  color: var(--primary);
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  min-width: 200px;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  padding: 1rem 0;
}

.nav-links li:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 0.5rem 1.5rem;
  font-weight: 400;
}

.dropdown a:hover {
  background: var(--secondary);
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
}

/* Hero Section */
.hero {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding: 0 20px;
}

.hero-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7));
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  animation: fadeInUp 1s ease forwards;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.2rem;
  font-weight: 300;
  margin-bottom: 2rem;
  text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--primary);
  color: var(--white);
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--primary-light);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 90, 156, 0.3);
}

/* Featured Section */
.section-title {
  text-align: center;
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 3rem;
  font-weight: 700;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

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

.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  height: 250px;
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-img img {
  transform: scale(1.1);
}

.card-content {
  padding: 1.5rem;
}

.card-content h3 {
  font-size: 1.25rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.card-content p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Category Header (For category.html) */
.category-header {
  padding: 10rem 2rem 5rem;
  text-align: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
}

.category-header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Footer */
footer {
  background: var(--text-dark);
  color: var(--white);
  padding: 3rem 2rem;
  text-align: center;
}

/* AI Chatbot Widget */
.chatbot-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 10000;
}

.chat-btn {
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  border: none;
}

.chat-btn:hover {
  transform: scale(1.1);
  background: var(--primary-light);
}

.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
}

.chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chat-header {
  background: var(--primary);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.close-chat {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f8f9fa;
}

.message {
  max-width: 80%;
  padding: 0.8rem 1rem;
  border-radius: 15px;
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.bot {
  background: var(--white);
  align-self: flex-start;
  border-bottom-left-radius: 0;
  box-shadow: var(--shadow-sm);
  color: var(--text-dark);
}

.message.user {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 0;
}

.chat-input {
  display: flex;
  padding: 1rem;
  background: var(--white);
  border-top: 1px solid #eee;
}

.chat-input input {
  flex: 1;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 20px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.3s;
}

.chat-input input:focus {
  border-color: var(--primary);
}

.chat-input button {
  background: var(--primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-left: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.chat-input button:hover {
  background: var(--primary-light);
}

/* Markdown styling inside bot message */
.message.bot p { margin-bottom: 0.5em; }
.message.bot p:last-child { margin-bottom: 0; }
.message.bot a { color: var(--primary); text-decoration: underline; }
.message.bot strong { font-weight: 700; }

/* API Key Modal */
.api-key-modal {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255,255,255,0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  z-index: 10;
}
.api-key-modal input {
  width: 100%;
  padding: 0.8rem;
  margin: 1rem 0;
  border: 1px solid #ccc;
  border-radius: var(--radius);
}
.api-key-modal button {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--white);
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    transition: var(--transition);
  }
  
  .nav-links.active {
    left: 0;
  }
  
  .mobile-menu-btn {
    display: block;
  }

  .dropdown {
    position: static;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    background: #f9f9f9;
  }

  .nav-links li:hover .dropdown {
    display: block;
  }

  .hero h1 { font-size: 2.5rem; }
  
  .chat-window {
    width: calc(100vw - 40px);
    right: -10px;
    height: 400px;
  }
}
