/*
Theme Name: Bengali Calendar PWA
Theme URI: https://calendar.tipsweb.in
Author: tipsweb.in
Author URI: https://tipsweb.in
Description: Bengali Calendar PWA for West Bengal government employees. Shows today Bengali date, monthly calendar, date converter, and holiday list. Works as installable PWA app.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: bengali-calendar
*/

/* =============================================
   COLOR VARIABLES
   These are "nicknames" for colors.
   Change a value here = updates everywhere.
   ============================================= */
:root {
  --saffron:    #D4521A;   /* main brand color */
  --saffron-lt: #F26B2E;   /* lighter saffron for hover states */
  --saffron-bg: #FFF3EC;   /* very light saffron background */
  --deep:       #17120A;   /* very dark brown for header/footer */
  --gold:       #B8820A;   /* gold accent */
  --gold-lt:    #E8A817;   /* lighter gold */
  --cream:      #FBF7F1;   /* page background */
  --white:      #FFFFFF;
  --green:      #1E6B3E;   /* govt holiday color */
  --green-lt:   #2A9055;
  --red:        #C0392B;   /* sunday color */
  --border:     #E2D9D0;   /* borders on cards and inputs */
  --gray-700:   #4A4035;
  --gray-500:   #7A6E62;
  --gray-100:   #F0EBE4;
}

/* =============================================
   RESET — removes default browser spacing
   ============================================= */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =============================================
   BASE STYLES
   ============================================= */
body {
  background: var(--cream);
  color: var(--deep);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   SITE HEADER — sticky top bar
   ============================================= */
.site-header {
  background: var(--deep);
  padding: 0 24px;
  position: sticky;      /* sticks to top of page when scrolling */
  top: 0;
  z-index: 100;          /* floats above all other content */
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 36px; height: 36px;
  background: var(--saffron);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Hind Siliguri', sans-serif;
  font-size: 18px; color: white; font-weight: 700;
}
.logo-text { color: white; font-size: 15px; font-weight: 500; }
.logo-text span { color: var(--gold-lt); }

/* Top navigation links */
.site-nav { display: flex; gap: 4px; }
.nav-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  font-family: 'Hind Siliguri', sans-serif;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.1);
  color: white;
}
.nav-link.active { color: var(--gold-lt); }

/* Install App button in header */
.pwa-install-btn {
  background: var(--saffron);
  color: white; border: none;
  padding: 7px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.pwa-install-btn:hover { background: var(--saffron-lt); }

/* =============================================
   HERO SECTION — large Bengali date display
   ============================================= */
.hero {
  background: var(--deep);
  padding: 48px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;     /* hides the watermark text that goes outside */
}
/* Faint decorative watermark text behind the date */
.hero::before {
  content: 'বাংলা';
  position: absolute;
  font-family: 'Hind Siliguri', sans-serif;
  font-size: 200px; font-weight: 700;
  color: rgba(255,255,255,0.025);  /* almost invisible */
  top: -30px; left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;  /* so it never blocks clicks */
}
/* "LIVE" indicator pill */
.today-label {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(212,82,26,0.2);
  border: 1px solid rgba(212,82,26,0.4);
  color: var(--saffron-lt);
  font-size: 11px; font-weight: 500;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 5px 14px; border-radius: 20px;
  margin-bottom: 24px;
}
.today-label::before { content: '●'; font-size: 8px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* The actual Bengali date text */
.bengali-date-display { font-family: 'Hind Siliguri', sans-serif; color: white; margin-bottom: 8px; }
.bd-weekday    { font-size: 18px; color: var(--gold-lt); display: block; margin-bottom: 6px; }
.bd-main       { font-size: clamp(48px, 10vw, 80px); font-weight: 700; line-height: 1; display: block; }
.bd-month-year { font-size: clamp(20px, 4vw, 28px); color: rgba(255,255,255,0.75); display: block; margin-top: 6px; }
.english-date  { margin-top: 16px; font-size: 14px; color: rgba(255,255,255,0.4); }

/* Action buttons below the date */
.hero-actions { display: flex; gap: 10px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.btn-primary {
  background: var(--saffron); color: white; border: none;
  padding: 11px 22px; border-radius: 8px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: 'Hind Siliguri', sans-serif;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--saffron-lt); transform: translateY(-1px); }
.btn-secondary {
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 11px 22px; border-radius: 8px;
  font-size: 14px; cursor: pointer;
  font-family: 'Hind Siliguri', sans-serif; transition: background 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); }

/* =============================================
   MAIN CONTENT AREA
   ============================================= */
.main-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}
/* Two-column layout: left = calendar, right = sidebar */
.two-col {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

/* =============================================
   CARD — white rounded box used everywhere
   ============================================= */
.card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(23,18,10,0.08);
  margin-bottom: 20px;
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-family: 'Hind Siliguri', sans-serif; font-size: 17px; font-weight: 600; }

/* =============================================
   CALENDAR GRID
   ============================================= */
/* Prev / Next month arrows */
.month-nav { display: flex; align-items: center; gap: 12px; }
.month-nav button {
  width: 32px; height: 32px;
  border: 1px solid var(--border); background: var(--cream);
  border-radius: 8px; cursor: pointer; font-size: 16px;
  transition: all 0.15s; color: var(--gray-700);
}
.month-nav button:hover { background: var(--saffron); color: white; border-color: var(--saffron); }
.month-nav .month-label {
  font-family: 'Hind Siliguri', sans-serif;
  font-size: 15px; font-weight: 600;
  min-width: 160px; text-align: center;
}

.cal-body { padding: 16px; }

/* Row of day names: Sun Mon Tue... */
.cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 6px; }
.cal-wd {
  text-align: center; font-size: 11px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--gray-500); padding: 6px 0;
}
.cal-wd.sun { color: var(--red); }
.cal-wd.sat { color: var(--green); }

/* 7-column date cells grid */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.cal-cell {
  aspect-ratio: 1;              /* square cells */
  border-radius: 10px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.cal-cell:hover { background: var(--gray-100); }
.cal-cell .en-num { font-size: 13px; font-weight: 500; color: var(--gray-700); line-height: 1; }
.cal-cell .bn-num { font-size: 10px; color: var(--gray-500); font-family: 'Hind Siliguri',sans-serif; line-height:1; margin-top:2px; }
/* Today — filled with saffron */
.cal-cell.today { background: var(--saffron) !important; }
.cal-cell.today .en-num { color: white; font-weight: 700; }
.cal-cell.today .bn-num { color: rgba(255,255,255,0.8); }
/* Weekend colors */
.cal-cell.sunday   .en-num { color: var(--red); }
.cal-cell.saturday .en-num { color: var(--green); }
/* Previous/next month dates — faded */
.cal-cell.other-month { opacity: 0.3; }
/* Small dot below date = has a holiday */
.cal-cell.has-holiday::after {
  content: ''; position: absolute; bottom: 3px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--gold);
}
.cal-cell.today.has-holiday::after { background: white; }

/* =============================================
   HOLIDAY LIST
   ============================================= */
.holidays-list { padding: 0; }
.holiday-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s;
}
.holiday-item:last-child { border-bottom: none; }
.holiday-item:hover { background: var(--cream); }
/* Small date box on the left */
.hol-date { min-width: 42px; text-align: center; background: var(--saffron-bg); border-radius: 8px; padding: 6px 4px; }
.hol-date .hol-day { font-size: 18px; font-weight: 700; color: var(--saffron); display: block; line-height: 1; }
.hol-date .hol-mon { font-size: 9px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; display: block; }
.hol-info { flex: 1; }
.hol-name    { font-family: 'Hind Siliguri',sans-serif; font-size: 14px; font-weight: 600; display: block; }
.hol-name-bn { font-family: 'Hind Siliguri',sans-serif; font-size: 13px; color: var(--gray-500); display: block; margin-top: 1px; }
/* Colored type badges */
.hol-badge { font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.badge-govt       { background: #E8F4EE; color: var(--green); }
.badge-festival   { background: #FFF8E8; color: var(--gold); }
.badge-restricted { background: #FFF0EC; color: var(--saffron); }

/* =============================================
   DATE CONVERTER
   ============================================= */
.converter-body { padding: 20px; }
/* Toggle: English→Bengali | Bengali→English */
.conv-tabs {
  display: flex; background: var(--gray-100);
  border-radius: 8px; padding: 3px; margin-bottom: 16px; gap: 2px;
}
.conv-tab {
  flex: 1; padding: 7px; border: none; background: transparent;
  border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer;
  font-family: 'Hind Siliguri', sans-serif; color: var(--gray-500); transition: all 0.15s;
}
.conv-tab.active { background: white; color: var(--saffron); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
/* Input fields */
.conv-input-group { margin-bottom: 12px; }
.conv-input-group label {
  display: block; font-size: 11px; font-weight: 500;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--gray-500); margin-bottom: 6px;
}
.conv-input-group input,
.conv-input-group select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: 'Hind Siliguri', sans-serif;
  color: var(--deep); background: var(--cream); outline: none;
  transition: border-color 0.2s;
}
.conv-input-group input:focus,
.conv-input-group select:focus { border-color: var(--saffron); background: white; }
/* Result output box */
.conv-result { background: var(--deep); border-radius: 10px; padding: 16px; text-align: center; margin-top: 14px; }
.conv-result .result-label { font-size: 11px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.conv-result .result-value { font-family: 'Hind Siliguri',sans-serif; font-size: 22px; font-weight: 700; color: var(--gold-lt); line-height: 1.3; }
.conv-result .result-sub   { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 4px; }
/* Convert button */
.btn-convert {
  width: 100%; background: var(--saffron); color: white; border: none;
  padding: 11px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: 'Hind Siliguri', sans-serif;
  margin-top: 12px; transition: background 0.2s;
}
.btn-convert:hover { background: var(--saffron-lt); }

/* =============================================
   PWA INSTALL BANNER
   ============================================= */
.pwa-banner {
  background: linear-gradient(135deg, var(--deep) 0%, #2D1F0A 100%);
  border-radius: 16px; padding: 20px;
  display: flex; align-items: center; gap: 16px;
  border: 1px solid rgba(184,130,10,0.25); margin-bottom: 16px;
}
.pwa-icon {
  width: 52px; height: 52px; background: var(--saffron);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.pwa-text h4 { font-size: 14px; font-weight: 600; color: white; font-family: 'Hind Siliguri',sans-serif; margin-bottom: 3px; }
.pwa-text p  { font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.4; }
.pwa-text .pwa-btn {
  display: inline-block; margin-top: 10px;
  background: var(--gold); color: var(--deep);
  font-size: 12px; font-weight: 600; padding: 6px 14px;
  border-radius: 6px; cursor: pointer; border: none;
  font-family: 'DM Sans', sans-serif; transition: background 0.15s;
}
.pwa-text .pwa-btn:hover { background: var(--gold-lt); }

/* =============================================
   SITE FOOTER
   ============================================= */
.site-footer {
  background: var(--deep);
  color: rgba(255,255,255,0.4);
  text-align: center; padding: 24px; font-size: 13px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.site-footer a { color: var(--gold-lt); text-decoration: none; }

/* =============================================
   RESPONSIVE — mobile phones (under 768px)
   ============================================= */
@media (max-width: 768px) {
  .two-col  { grid-template-columns: 1fr; }  /* stack into single column */
  .site-nav { display: none; }               /* hide desktop nav on mobile */
  .hero     { padding: 36px 20px 32px; }
  .bd-main  { font-size: 52px; }
}
