/* =============================================================
   Dahlem Agro Development Initiatives Limited
   assets/css/app.css — Global stylesheet
   Loaded on every page alongside Tailwind CSS CDN
   ============================================================= */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&family=Open+Sans:wght@400;500&display=swap');

/* -------------------------------------------------------------
   CSS Custom Properties
   ------------------------------------------------------------- */
:root {
  --green:       #2d6a4f;
  --dark-green:  #1b4332;
  --gold:        #d4a017;
  --brown:       #6b4226;
  --cream:       #f5f0e8;
  --charcoal:    #1a1a1a;
}

/* -------------------------------------------------------------
   Base
   ------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  background-color: #1a1a1a; /* matches footer — prevents white flash at page bottom */
}

body {
  font-family: 'Open Sans', sans-serif;
  background:  var(--cream);
  color:       var(--charcoal);
  line-height: 1.7;
  font-size:   16px;
}

/* -------------------------------------------------------------
   Headings
   ------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family:    'Montserrat', sans-serif;
  font-weight:    700;
  letter-spacing: 0.5px;
}

h1 { font-size: 48px; }
h2 { font-size: 36px; }
h3 { font-size: 24px; }

@media (max-width: 768px) {
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
}

/* -------------------------------------------------------------
   Section Spacing
   ------------------------------------------------------------- */
.section-padding {
  padding-top:    80px;
  padding-bottom: 80px;
}

@media (max-width: 768px) {
  .section-padding {
    padding-top:    48px;
    padding-bottom: 48px;
  }
}

/* -------------------------------------------------------------
   Gold Accent Underline
   ------------------------------------------------------------- */
.gold-underline {
  display:       block;
  width:         60px;
  height:        3px;
  background:    var(--gold);
  border-radius: 2px;
  margin:        12px auto 0;
}

.gold-underline-left {
  display:       block;
  width:         60px;
  height:        3px;
  background:    var(--gold);
  border-radius: 2px;
  margin:        12px 0 0 0;
}

/* -------------------------------------------------------------
   Fade-In-Up Animation (scroll-triggered via JS observer)
   ------------------------------------------------------------- */
.fade-in-up {
  opacity:    0;
  transform:  translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity:   1;
  transform: translateY(0);
}

/* -------------------------------------------------------------
   Navbar Scroll Shadow
   ------------------------------------------------------------- */
.navbar-scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.3s ease;
}

/* -------------------------------------------------------------
   Float Card Animation
   ------------------------------------------------------------- */
.float-card {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,  100% { transform: translateY(0);    }
  50%        { transform: translateY(-8px); }
}

/* -------------------------------------------------------------
   Card Hover Effect
   ------------------------------------------------------------- */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform:  translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* -------------------------------------------------------------
   Buttons
   ------------------------------------------------------------- */
.btn-primary {
  background:    var(--gold);
  color:         var(--charcoal);
  font-family:   'Montserrat', sans-serif;
  font-weight:   600;
  border-radius: 6px;
  padding:       12px 28px;
  transition:    background 0.3s ease, transform 0.2s ease;
  display:       inline-block;
  cursor:        pointer;
  border:        none;
  text-decoration: none;
}

.btn-primary:hover {
  background: #b8860b;
  transform:  translateY(-1px);
}

.btn-secondary {
  border:        2px solid var(--green);
  color:         var(--green);
  font-family:   'Montserrat', sans-serif;
  font-weight:   600;
  border-radius: 6px;
  padding:       10px 26px;
  transition:    all 0.3s ease;
  display:       inline-block;
  cursor:        pointer;
  background:    transparent;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--green);
  color:      #ffffff;
}

/* -------------------------------------------------------------
   Section Title
   ------------------------------------------------------------- */
.section-title {
  font-family:   'Montserrat', sans-serif;
  font-weight:   700;
  color:         var(--dark-green);
  text-align:    center;
  margin-bottom: 12px;
}

/* -------------------------------------------------------------
   Custom Scrollbar
   ------------------------------------------------------------- */
::-webkit-scrollbar        { width: 6px; }
::-webkit-scrollbar-thumb  { background: var(--green); border-radius: 4px; }
::-webkit-scrollbar-track  { background: var(--cream); }

/* -------------------------------------------------------------
   Mobile Menu Slide Transition
   ------------------------------------------------------------- */
.mobile-menu {
  max-height: 0;
  overflow:   hidden;
  transition: max-height 0.35s ease;
}

.mobile-menu.open {
  max-height: 500px;
}

/* -------------------------------------------------------------
   Carousel Dot Indicators
   ------------------------------------------------------------- */
.dot {
  width:         10px;
  height:        10px;
  background:    #d1d5db;
  border-radius: 50%;
  cursor:        pointer;
  transition:    background 0.3s ease;
  display:       inline-block;
}

.dot.active {
  background: var(--gold);
}

/* -------------------------------------------------------------
   Dashboard Sidebar
   ------------------------------------------------------------- */
.sidebar {
  transition: width 0.3s ease;
}

.sidebar.collapsed {
  width:    64px;
  overflow: hidden;
}

/* -------------------------------------------------------------
   Modal Backdrop & Box
   ------------------------------------------------------------- */
.modal-backdrop {
  position:   fixed;
  inset:      0;
  background: rgba(0, 0, 0, 0.5);
  z-index:    40;
}

.modal-box {
  position:        fixed;
  inset:           0;
  display:         flex;
  align-items:     center;
  justify-content: center;
  z-index:         50;
}

.modal-open  { display: flex; }
.modal-closed { display: none; }

/* -------------------------------------------------------------
   Toast Notifications
   ------------------------------------------------------------- */
.toast-container {
  position:       fixed;
  bottom:         1rem;
  right:          1rem;
  z-index:        50;
  display:        flex;
  flex-direction: column;
  gap:            0.5rem;
}

.toast {
  min-width:    280px;
  background:   #ffffff;
  border-radius: 0.75rem;
  box-shadow:   0 4px 16px rgba(0, 0, 0, 0.12);
  border-left:  4px solid transparent;
  padding:      0.75rem 1rem;
  animation:    slideInRight 0.3s ease;
}

.toast.success { border-color: var(--green); }
.toast.error   { border-color: #ef4444; }
.toast.warning { border-color: var(--gold); }
.toast.info    { border-color: #3b82f6; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* -------------------------------------------------------------
   Stats Counter Number
   ------------------------------------------------------------- */
.stat-number {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

/* -------------------------------------------------------------
   Prefers Reduced Motion — disable all animations
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .fade-in-up {
    transition: none;
    opacity:    1;
    transform:  none;
  }

  .card-hover:hover {
    transform: none;
  }

  .float-card {
    animation: none;
  }
}
