/* ======================================
   CASHORO SMART POS – GLOBAL STYLES
   ====================================== */

/* ===== COLOR VARIABLES ===== */
:root {
  /* Brand Colors */
  --color-mint: #10B981;        /* Primary action / success */
  --color-yellow: #F59E0B;      /* Warning / highlight */
  --color-cloud: #FFFFFF;       /* Card background */
  --color-bg: #F3F4F6;          /* App background & sidebar */
  --color-charcoal: #1F2937;    /* Main text & icons */
  --color-warning: #EF4444;     /* Danger / loss */

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 60px;
  --border-radius: 12px;
  --shadow: 0 4px 12px rgba(0,0,0,0.06);
  --light-border: #E5E7EB;
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-charcoal);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
  display: inline-block;
  text-align: center;
}
.btn-primary {
  background-color: var(--color-mint);
  color: white;
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-secondary {
  background-color: var(--color-yellow);
  color: white;
}
.btn-secondary:hover {
  opacity: 0.9;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--color-charcoal);
  color: var(--color-charcoal);
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-charcoal);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--light-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
}
.form-group textarea {
  height: 120px;
  resize: vertical;
}

/* ===== CARDS & CONTAINERS ===== */
.card {
  background: var(--color-cloud);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

/* ===== UTILITIES ===== */
.text-mint { color: var(--color-mint); font-weight: 600; }
.text-warning { color: var(--color-warning); }
.text-bold { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }

/* ======================================
   LAYOUT: INTERNAL PAGES (Dashboard, Order, etc.)
   ====================================== */

/* Only apply grid layout to internal pages (not public/auth pages) */
body:not(.index-page):not(.auth-page):not(.legal-page) {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  min-height: 100vh;
  background-color: var(--color-bg);
}

/* SIDEBAR */
.sidebar {
  grid-area: sidebar;
  background-color: var(--color-bg);
  padding: 1.5rem 0;
  border-right: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-logo {
  padding: 0 1.5rem 1.5rem;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-mint);
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  color: var(--color-charcoal);
  font-weight: 500;
  border-left: 4px solid transparent;
  transition: all 0.2s ease;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background-color: rgba(16, 185, 129, 0.08);
  border-left-color: var(--color-mint);
  color: var(--color-mint);
}

/* HEADER */
.header {
  grid-area: header;
  background-color: var(--color-cloud);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  z-index: 10;
}

/* MAIN CONTENT */
main {
  grid-area: main;
  padding: 1.5rem;
  overflow-y: auto;
}

/* ======================================
   LAYOUT: PUBLIC & AUTH PAGES
   (index, login, signup)
   ====================================== */

/* Landing Page */
body.index-page {
  background-color: white;
}
.hero-section {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  padding: 4rem 1.5rem;
  text-align: center;
}
.hero-section h1 {
  font-size: 2.2rem;
  color: var(--color-charcoal);
  margin-bottom: 1rem;
}
.hero-section p {
  font-size: 1.05rem;
  color: #4b5563;
  max-width: 600px;
  margin: 0 auto 2rem;
}
.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.features-section {
  padding: 3rem 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--color-cloud);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  text-align: center;
}
.feature-card h3 {
  margin: 0.5rem 0;
  color: var(--color-charcoal);
}

/* Auth Pages (Login & Signup) */
body.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f9fafb;
  padding: 1rem;
}
.auth-card {
  background: var(--color-cloud);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 420px;
}
.auth-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--color-charcoal);
}
.divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
  color: #9CA3AF;
}
.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--light-border);
  z-index: 0;
}
.divider span {
  background: white;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}
.social-login {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-border);
  color: var(--color-charcoal);
  font-weight: bold;
  text-decoration: none;
  transition: background 0.2s;
}
.social-btn:hover {
  background: #d1d5db;
}
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #6B7280;
}
.auth-footer a {
  color: var(--color-mint);
  font-weight: 600;
}
.role-note {
  font-size: 0.85rem;
  color: #6B7280;
  margin-top: 0.25rem;
}

/* ======================================
   LEGAL PAGES STYLES
   (Privacy Policy, Terms, Contact)
   ====================================== */

body.legal-page {
  background-color: var(--color-cloud);
}
.legal-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.legal-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--light-border);
}
.legal-header h1 {
  font-size: 2rem;
  color: var(--color-mint);
  margin-bottom: 0.5rem;
}
.legal-header p.subtitle {
  color: #6B7280;
  font-size: 1rem;
}
.legal-section {
  margin-bottom: 2rem;
}
.legal-section h2 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--color-charcoal);
}
.legal-section p,
.legal-section ul {
  margin-bottom: 1rem;
}
ul {
  padding-left: 1.5rem;
}
li {
  margin-bottom: 0.5rem;
}
.back-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--color-mint);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}
.back-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Contact Page Specific */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}
.contact-card {
  background: #fafafa;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.contact-card h2 {
  color: var(--color-mint);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}
.contact-info {
  list-style: none;
}
.contact-info li {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.contact-info svg {
  flex-shrink: 0;
  color: var(--color-mint);
  margin-top: 0.25rem;
}

/* ======================================
   RESPONSIVE
   ====================================== */

@media (max-width: 768px) {
  /* Hide sidebar on mobile for internal pages */
  body:not(.index-page):not(.auth-page):not(.legal-page) {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main";
  }
  .sidebar {
    display: none;
  }

  /* Stack CTA buttons */
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  .cta-buttons .btn {
    width: 100%;
    max-width: 300px;
  }
}