/* =============================================================================
   assets/css/styles.css — Version 1.1
   =============================================================================
   1) Sidebar & Dashboard Layout
   2) Base Form / Button / Alert / Table Styles
   3) “Generate Invoice” Form Styles (invoice_create.php)
   4) Landing Page Styles (index.php)
   ============================================================================= */

/* ========== 1) Root Color Variables ========== */
:root {
  --brand-dark-green: #0b1e0c;
  --brand-light-green: #acff03;
  --text-color: #333;
  --bg-color: #f9f9f9;
}

/* ========== 2) Reset & Base Styles ========== */
* {
  box-sizing: border-box;
}
body, h1, h2, h3, h4, h5, h6, p, ul, ol, table {
  margin: 0;
  padding: 0;
}
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: Arial, sans-serif;
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

/* Container Utility */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ========== 3) Sidebar & Dashboard Layout ========== */
/* Sidebar (left navigation) */
.sidebar {
  width: 240px;
  background-color: var(--brand-dark-green);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
}
.sidebar .logo-container {
  padding: 20px;
  text-align: center;
  border-bottom: 2px solid #214D00;
}
.sidebar .logo-container img {
  max-width: 140px;
  height: auto;
}
.sidebar .logo-container h2 {
  color: var(--brand-light-green);
  font-size: 1.2rem;
  margin: 10px 0 0;
  font-weight: 600;
}

/* Sidebar navigation links */
.sidebar nav {
  flex: 1;
  margin-top: 20px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  color: var(--brand-light-green);
  text-decoration: none;
  font-size: 1rem;
  padding: 12px 20px;
  transition: background-color 0.2s;
}
.sidebar nav a i {
  margin-right: 12px;
  font-size: 1.1rem;
}
/* Only the link with class="active" (or hovered) is highlighted */
.sidebar nav a.active,
.sidebar nav a:hover {
  background-color: var(--brand-light-green);
  color: var(--brand-dark-green);
}

/* Main content (to the right of sidebar) */
.main-content {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
/* … earlier CSS above … */

/* Top bar (for user profile icon) */
.main-top-bar {
  background-color: #FFFFFF;
  padding: 12px 24px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border-bottom: 1px solid #E0E0E0;
}

.main-top-bar .user-menu {
  position: relative;
}

.main-top-bar .user-icon {
  display: inline-block;       /* don’t rely on flex here */
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-image: url('https://piktome.com/wp-content/uploads/2025/05/cropped-Circular-Logo-green.png');
  background-size: cover;
  background-position: center; /* newly added */
  background-repeat: no-repeat;/* newly added */
  /* remove font-size, color, justify-content, align-items etc. */
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}


/* ↓↓↓ Replace this old hover‐only rule ↓↓↓
   .main-top-bar .user-menu:hover .dropdown-menu {
     display: block;
   }
   ↑↑↑ End of old rule ↑↑↑ */

/* *************************************
   Top Bar / User Menu (Click to Toggle)
   ************************************* */

/* 1) Hide the dropdown by default */
.main-top-bar .dropdown-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  min-width: 140px;
  border-radius: 4px;
  display: none;     /* hidden until .active is added */
  z-index: 10;
}

/* 2) Only show the dropdown when .user-menu has .active */
.main-top-bar .user-menu.active .dropdown-menu {
  display: block;
}

.main-top-bar .dropdown-menu a {
  display: block;
  padding: 8px 12px;
  color: #333;
  text-decoration: none;
}
.main-top-bar .dropdown-menu a:hover {
  background-color: #f0f0f0;
}

/* Content area (below the top bar) */
.content-area {
  flex: 1;
  background-color: #F0F0F0;
  padding: 24px;
}

/* Content area (below the top bar) */
.content-area {
  flex: 1;
  background-color: #F0F0F0;
  padding: 24px;
}

/* Dashboard stat cards (example usage in dashboard.php) */
.stats-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
}
.stats-cards .card {
  background-color: var(--brand-light-green);
  border-radius: 8px;
  flex: 1 1 200px;
  max-width: 240px;
  color: var(--brand-dark-green);
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.stats-cards .card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 500;
}
.stats-cards .card .stat-number {
  font-size: 2.5rem;
  font-weight: 600;
  margin: 0;
}

/* Footer (sticky at bottom) */
.main-footer {
  background-color: var(--brand-dark-green);
  color: #FFFFFF;
  text-align: center;
  padding: 16px 10px;
  font-size: 0.85rem;
  border-top: 2px solid #214D00;
  margin-top: auto;
}

/* ========== 4) Base Form / Button / Alert / Table Styles ========== */
/* Forms */
.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}
.form-group label {
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.form-control,
.form-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand-light-green);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  margin-top: 5px;
  transition: background-color 0.2s ease;
}
.btn-primary {
  background-color: var(--brand-dark-green);
  color: var(--brand-light-green);
}
.btn-primary:hover {
  background-color: #0f2915;
}
.btn-success {
  background-color: var(--brand-light-green);
  color: #000;
}
.btn-success:hover {
  background-color: #b3ff74;
  color: #000;
}
.btn-secondary {
  background-color: #555;
  color: #fff;
}
.btn-secondary:hover {
  background-color: #333;
}
.btn-danger {
  background-color: #d9534f;
  color: #fff;
}
.btn-danger:hover {
  background-color: #c9302c;
}

/* Alerts */
.alert {
  padding: 10px 15px;
  border-radius: 4px;
  margin-top: 15px;
}
.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}
.table th,
.table td {
  border: 1px solid #ddd;
  padding: 8px;
}
.table th {
  background-color: var(--brand-dark-green);
  color: var(--brand-light-green);
  text-align: left;
}
.table tr:nth-child(even) {
  background-color: #f2f2f2;
}

/* Utility spacing classes */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-end    { text-align: right; }

/* ========== 5) “Generate Invoice” Form Styling (invoice_create.php) ========== */
.generate-invoice-form {
  background-color: #fff;
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.generate-invoice-form h2 {
  margin-bottom: 1rem;
}
.generate-invoice-form .line-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
}
.generate-invoice-form .line-item .form-control {
  width: 100%;
}
.generate-invoice-form .line-item .btn-danger {
  align-self: center;
  width: 42px;
  height: 42px;
  padding: 0;
}
.generate-invoice-form .btn-add-item {
  margin-top: 10px;
  background-color: #555;
  color: #fff;
}
.generate-invoice-form .btn-add-item:hover {
  background-color: #444;
}
.generate-invoice-form .form-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

/* ========== 6) Landing Page Styling (index.php) ========== */
/* Hero Section */
.landing-hero {
  background: linear-gradient(
    135deg,
    rgba(172,255,3,0.3) 0%,
    rgba(11,30,12,1) 70%
  );
  color: #ffffff;
  text-align: center;
  padding: 100px 20px 80px 20px;
  position: relative;
}
.landing-hero::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle at top,
    rgba(172,255,3,0.6),
    transparent 70%
  );
  filter: blur(100px);
  z-index: 0;
}
.landing-hero .hero-inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}
.landing-hero .hero-inner img {
  max-height: 80px;
  margin-bottom: 20px;
}
.landing-hero .hero-inner h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #acff03;
}
.landing-hero .hero-inner p {
  font-size: 1.2rem;
  margin-bottom: 30px;
}
.landing-hero .hero-inner .btn-get-started {
  display: inline-block;
  border: 2px solid var(--brand-light-green);
  color: var(--brand-light-green);
  background: transparent;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 1rem;
  text-decoration: none;
  position: relative;
  z-index: 1;
  transition: background-color 0.2s ease;
}
.landing-hero .hero-inner .btn-get-started:hover {
  background-color: rgba(172,255,3,0.2);
}

/* Stats Section */
.landing-stats {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background-color: #ffffff;
  padding: 50px 20px;
  flex-wrap: wrap;
}
.landing-stats .stat {
  flex: 1 1 20%;
  max-width: 20%;
  text-align: center;
  margin-bottom: 20px;
}
.landing-stats .stat h2 {
  font-size: 2rem;
  color: var(--brand-dark-green);
}
.landing-stats .stat p {
  margin-top: 5px;
  font-size: 1rem;
  color: #555555;
}

/* Footer (landing page) */
.landing-footer {
  background-color: var(--brand-dark-green);
  color: #ffffff;
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
}

/* ========== 7) Responsive Adjustments ========== */
@media (max-width: 768px) {
  /* Sidebar becomes a top bar horizontally */
  .sidebar {
    position: relative;
    width: 100%;
    flex-direction: row;
    height: auto;
  }
  .sidebar .logo-container {
    display: none;
  }
  .sidebar nav {
    display: flex;
    justify-content: space-around;
    margin-top: 0;
    width: 100%;
  }
  .sidebar nav a {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 0.9rem;
    padding: 10px;
  }
  .main-content {
    margin-left: 0;
  }
  .main-top-bar {
    justify-content: space-between;
  }

  /* Stack line‐items vertically on mobile */
  .generate-invoice-form .line-item {
    display: flex;
    flex-direction: column;
  }
  .generate-invoice-form .line-item .form-control,
  .generate-invoice-form .line-item .btn-danger {
    width: 100%;
  }
  .generate-invoice-form .btn-add-item {
    width: 100%;
  }

  /* Landing stats: two columns on small screens */
  .landing-stats .stat {
    flex: 0 0 45%;
    max-width: 45%;
  }
}
