/* ===================================================
   SHREE CHEHAR ENERGY — Platform Common Stylesheet
   Solar Energy Company | Palanpur, Gujarat
   =================================================== */

:root {
  --navy-950: #040E18;
  --navy-900: #071A2B;
  --navy-800: #0B2438;
  --navy-700: #102F46;
  --navy-600: #1B4060;
  --navy-500: #25537B;
  --gold: #F5A623;
  --gold-hover: #E09000;
  --gold-light: #FFB52E;
  --gold-bg: rgba(245, 166, 35, 0.08);
  --gold-border: rgba(245, 166, 35, 0.25);
  --white: #FFFFFF;
  --off-white: #F7F9FC;
  --gray-50: #F8FAFC;
  --gray-100: #E2E8F0;
  --gray-200: #CBD5E1;
  --gray-300: #94A3B8;
  --gray-400: #64748B;
  --gray-500: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --text: #0B2438;
  --text-sec: #4A5C6F;
  --text-light: #64748B;
  --success: #10B981;
  --success-bg: #ECFDF5;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --info: #3B82F6;
  --info-bg: #EFF6FF;
  --wa: #25D366;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(11, 36, 56, 0.08);
  --shadow-lg: 0 10px 30px rgba(11, 36, 56, 0.12);
  --shadow-xl: 0 20px 40px rgba(7, 26, 43, 0.2);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --f-head: 'Poppins', sans-serif;
  --f-body: 'Inter', sans-serif;
  --tr: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-body);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--off-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--tr);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-head);
  color: var(--navy-900);
  font-weight: 700;
  line-height: 1.25;
}

.gold { color: var(--gold); }
.text-sec { color: var(--text-sec); }
.text-center { text-align: center; }

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 640px) {
  .container {
    padding: 0 1.15rem;
  }
}

@media (max-width: 375px) {
  .container {
    padding: 0 0.85rem;
  }
}

@media (max-width: 320px) {
  .container {
    padding: 0 0.65rem;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--tr);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-gold {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.btn-gold:hover {
  background: var(--gold-hover);
  border-color: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 166, 35, 0.3);
}

.btn-navy {
  background: var(--navy-900);
  color: var(--white);
  border-color: var(--navy-900);
}

.btn-navy:hover {
  background: var(--navy-800);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--navy-900);
  border-color: var(--gray-200);
}

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

.btn-outline-gold {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

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

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-pending { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-confirmed { background: var(--info-bg); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-processing { background: #F3E8FF; color: #9333EA; border: 1px solid rgba(147, 51, 234, 0.2); }
.badge-ready, .badge-active, .badge-published, .badge-approved, .badge-paid { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-completed { background: #D1FAE5; color: #065F46; font-weight: 700; }
.badge-cancelled, .badge-disabled, .badge-rejected, .badge-failed { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-new { background: #E0E7FF; color: #4338CA; border: 1px solid rgba(67, 56, 202, 0.2); }
.badge-read { background: var(--gray-100); color: var(--gray-500); }
.badge-contacted { background: #CFFAFE; color: #0E7490; }
.badge-closed { background: var(--gray-100); color: var(--gray-400); }

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.form-row-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .form-row-4col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .form-row-2col, .form-row-3col, .form-row-4col {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.form-label {
  font-family: var(--f-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-800);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--f-body);
  font-size: 0.92rem;
  background: var(--white);
  color: var(--text);
  transition: var(--tr);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.12);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
}

/* Flash Alerts */
.flash-container {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease;
}

.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  font-size: 1.1rem;
}
.alert-close:hover { opacity: 1; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--gray-200);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  background: var(--gold-bg);
  color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon svg { width: 32px; height: 32px; }

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-light);
  max-width: 420px;
  margin: 0 auto 1.5rem;
  font-size: 0.9rem;
}

/* Card */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  transition: var(--tr);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2rem;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--navy-800);
}

.page-link:hover, .page-link.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.88rem;
    white-space: normal;
    text-align: center;
    word-break: break-word;
    min-height: 44px;
    max-width: 100%;
    line-height: 1.35;
  }
  .card { padding: 1.25rem; }
}

@media (max-width: 480px) {
  .btn {
    padding: 0.7rem 1rem;
    font-size: 0.84rem;
  }
  .card { padding: 1rem; }
}

/* Platform Navigation Bar */
.navbar-platform {
  background: var(--navy-900);
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.platform-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.platform-nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.platform-nav-item {
  color: rgba(255,255,255,0.85);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--tr);
}

.platform-nav-item:hover, .platform-nav-item.active {
  color: var(--gold);
}

.mobile-platform-btn {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  min-width: 44px;
  min-height: 44px;
}

.mobile-platform-btn svg {
  width: 26px;
  height: 26px;
}

@media (max-width: 900px) {
  .mobile-platform-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .platform-nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-900);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    box-shadow: var(--shadow-xl);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 1.5rem 1.5rem;
    max-height: calc(100dvh - 65px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .platform-nav-links.open {
    display: flex;
  }

  .platform-nav-links .platform-nav-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.95rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .platform-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1rem;
  }

  .platform-nav-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .platform-nav-container a:first-child {
    font-size: clamp(0.74rem, 3.4vw, 0.86rem) !important;
    gap: 0.45rem !important;
  }
  .platform-nav-container a:first-child img {
    height: 30px !important;
    max-width: 50px !important;
  }
}

@media (max-width: 375px) {
  .platform-nav-container a:first-child {
    font-size: 0.75rem !important;
  }
  .platform-nav-container a:first-child img {
    height: 28px !important;
    max-width: 44px !important;
  }
}

@media (max-width: 320px) {
  .platform-nav-container a:first-child {
    font-size: 0.7rem !important;
  }
  .platform-nav-container a:first-child img {
    height: 26px !important;
    max-width: 40px !important;
  }
}

/* Contact Page Layout */
.contact-page-layout {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 2.5rem;
  align-items: start;
  max-width: 1050px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .contact-page-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Common Admin & Account 2-Column Responsive Layouts */
.admin-detail-layout, .account-detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

.customer-detail-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .admin-detail-layout, .account-detail-layout, .customer-detail-layout {
    grid-template-columns: 1fr;
  }
}

/* Table Responsive Containers */
.admin-table-wrap,
.cart-table-wrap,
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
}

/* Footer Responsive Grid */
.footer-public-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 640px) {
  .footer-public-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

/* Footer Social Icons */
.footer-social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.social-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--tr-fast);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.social-link:hover {
  transform: translateY(-2px);
  color: #fff;
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.social-link.instagram:hover {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border-color: transparent;
}

.social-link.facebook:hover {
  background: #1877f2;
  border-color: #1877f2;
}

.social-link.whatsapp:hover {
  background: #25D366;
  border-color: #25D366;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
