/* RSU2 Website - Shared Styles
   Modern, responsive, professional design
   Easy to update: colors in :root, sections modular
*/

:root {
  --primary: #1a5f2a;      /* Green for agri/tech */
  --primary-dark: #0d3d1a;
  --secondary: #2c3e50;
  --accent: #27ae60;
  --light: #f8f9fa;
  --dark: #1a1a2e;
  --text: #333;
  --text-light: #666;
  --white: #ffffff;
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 8px;
  --transition: all 0.3s ease;
  --header-h: 70px;
  --tools-h: 40px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--light);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== TOOLS BAR ========== */
.tools-bar {
  background: var(--secondary);
  color: var(--white);
  height: var(--tools-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  font-size: 0.85rem;
}

.tools-left, .tools-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tools-bar a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: var(--transition);
}

.tools-bar a:hover {
  color: var(--white);
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 2px 10px;
}

.search-box input {
  background: transparent;
  border: none;
  color: white;
  padding: 4px 8px;
  width: 140px;
  outline: none;
}

.search-box input::placeholder {
  color: rgba(255,255,255,0.6);
}

.search-box button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
}

.theme-toggle, .lang-select {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

/* ========== HEADER / NAV ========== */
.main-header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: var(--header-h);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.5rem;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
}

/* Main Navigation */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--secondary);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--primary);
  color: white;
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--secondary);
  padding: 0.3rem;
}

/* ========== SECONDARY MENU BAR ========== */
.menu-bar {
  background: var(--primary);
  color: white;
  padding: 0.4rem 0;
}

.menu-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.menu-bar a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: var(--transition);
}

.menu-bar a:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

.menu-bar .label {
  font-weight: 600;
  margin-right: 0.5rem;
  opacity: 0.8;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========== SLIDESHOW ========== */
.slideshow-container {
  position: relative;
  max-width: 1200px;
  margin: 1.5rem auto;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #ddd;
  height: 380px;
}

.slide {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
}

.slide.active {
  display: block;
  animation: fadeIn 0.6s ease;
}

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

.slide-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2c3e50, #1a5f2a);
  color: white;
  text-align: center;
  padding: 2rem;
}

.slide-placeholder h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.slide-placeholder p {
  opacity: 0.9;
  max-width: 500px;
}

.slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: white;
  padding: 2rem 1.5rem 1.2rem;
}

.slideshow-controls {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.dot.active, .dot:hover {
  background: white;
  transform: scale(1.15);
}

.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: white;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 1.3rem;
  border-radius: 4px;
  z-index: 10;
  transition: var(--transition);
}

.prev:hover, .next:hover {
  background: rgba(0,0,0,0.7);
}

.prev { left: 12px; }
.next { right: 12px; }

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
}

.page-title {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.3rem;
}

.page-subtitle {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.section h2 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.section h3 {
  color: var(--secondary);
  margin: 1rem 0 0.5rem;
}

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

.card {
  background: var(--light);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid #e0e0e0;
  transition: var(--transition);
}

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

.card h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

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

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Image placeholders */
.img-placeholder {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 500;
  margin: 1rem 0;
  text-align: center;
  padding: 1rem;
}

.img-placeholder.large {
  height: 280px;
}

/* ========== FOOTER ========== */
.main-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.85);
  padding: 2.5rem 1.5rem 1rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-col h4 {
  color: white;
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* ========== UTILITY ========== */
.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  margin-left: 0.4rem;
}

/* Update notice */
.update-note {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #856404;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem;
  }

  .main-nav.open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
  }

  .main-nav a {
    display: block;
    padding: 0.75rem 1rem;
  }

  .menu-toggle {
    display: block;
  }

  .slideshow-container {
    height: 280px;
  }

  .tools-bar {
    flex-wrap: wrap;
    height: auto;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
  }

  .search-box input {
    width: 100px;
  }
}

@media (max-width: 600px) {
  .page-title {
    font-size: 1.6rem;
  }

  .slideshow-container {
    height: 220px;
    margin: 1rem 0.5rem;
  }

  .slide-placeholder h2 {
    font-size: 1.4rem;
  }

  .header-inner {
    padding: 0 1rem;
  }
}

/* Dark mode support (toggled via JS) */
body.dark-mode {
  --light: #121212;
  --white: #1e1e1e;
  --text: #e0e0e0;
  --text-light: #aaa;
  --dark: #0a0a0a;
  --shadow: 0 4px 12px rgba(0,0,0,0.4);
}

body.dark-mode .main-header {
  background: #1e1e1e;
}

body.dark-mode .card {
  background: #252525;
  border-color: #333;
}

body.dark-mode .img-placeholder {
  background: linear-gradient(135deg, #1a3a1a, #0d2d0d);
  border-color: var(--accent);
  color: var(--accent);
}

body.dark-mode .update-note {
  background: #3d3500;
  border-color: #665c00;
  color: #ffe082;
}
