@import url('/responsive.css');

/* 
 * Devrath Premium Card System
 * Enforcing high-fidelity, domain-native aesthetics.

 * Compliance: Zero-pill, typographic hierarchy, viewport presence.
 */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding: 1.5rem 0;
}

/* Primary Card Structure */
.card {
  background: #FFFBF0; /* Premium Cream */
  border: 1px solid #D5C9A9; /* Hairline all-around */
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 4px 12px rgba(25, 36, 79, 0.04);
  transition: transform 0.4s cubic-bezier(0.1, 0.9, 0.2, 1), box-shadow 0.4s ease, border-color 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px) rotateX(2deg) rotateY(1deg);
  box-shadow: 0 20px 40px rgba(25, 36, 79, 0.12);
  border-color: #E3A21A;
}

/* Decorative top hairline for variants */
.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  transition: background 0.3s ease;
}

/* Typography inside cards */
.card h3, .card h4 {
  font-family: "Tiro Devanagari Hindi", serif;
  color: #19244F;
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(227, 162, 26, 0.2);
  font-size: 1.45rem;
  line-height: 1.3;
  font-weight: 400;
}

.card p {
  color: #1B1F33;
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
  flex-grow: 1;
}

.card ul, .card ol {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
  color: #4B4F66;
  font-size: 0.98rem;
}

.card li {
  margin-bottom: 0.5rem;
}

.card .card-footer {
  margin-top: auto;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Color Variants --- */

/* Navy Variant */
.card.navy { background: #FAF8F2; border-color: #D5C9A9; }
.card.navy::after { background: #19244F; }
.card.navy h3, .card.navy h4 { border-bottom-color: rgba(25, 36, 79, 0.2); }

/* Gold Variant */
.card.gold { background: #FFFBF0; border-color: #E4D7B8; }
.card.gold::after { background: #E3A21A; }
.card.gold h3, .card.gold h4 { border-bottom-color: rgba(227, 162, 26, 0.3); }

/* Green Variant */
.card.green { background: #F8FBFA; border-color: #D1E7E0; }
.card.green::after { background: #10B981; }
.card.green h3, .card.green h4 { border-bottom-color: rgba(16, 185, 129, 0.2); }

/* Orange Variant */
.card.orange { background: #FFFBF2; border-color: #E4D7B8; }
.card.orange::after { background: #F59E0B; }
.card.orange h3, .card.orange h4 { border-bottom-color: rgba(245, 158, 11, 0.2); }

/* Cream / Paper Variant (Default) */
.card.cream { background: #FAF8F2; border-color: #D5C9A9; }
.card.cream::after { background: #D5C9A9; }

/* Interactive Hover for high-intent accents */
.card:hover::after {
  height: 5px;
}

/* Staggered entrance animation (CSS-only) */
@media (prefers-reduced-motion: no-preference) {
  .card {
    opacity: 0;
    animation: cardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  
  .card:nth-child(1) { animation-delay: 0.1s; }
  .card:nth-child(2) { animation-delay: 0.15s; }
  .card:nth-child(3) { animation-delay: 0.2s; }
  .card:nth-child(4) { animation-delay: 0.25s; }
  .card:nth-child(5) { animation-delay: 0.3s; }
  .card:nth-child(6) { animation-delay: 0.35s; }
  .card:nth-child(n+7) { animation-delay: 0.4s; }
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Floating effect for featured cards */
@media (prefers-reduced-motion: no-preference) {
  .card.featured {
    animation: cardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards, float 6s ease-in-out infinite 0.8s;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Strict prefers-reduced-motion compliance */
@media (prefers-reduced-motion: reduce) {
  .card, .card.featured, .card:hover {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ===================================================
   DEVRATH ACCESSIBLE HIGH-CONTRAST BUTTON SYSTEM
   Navy (#19244F), Gold (#E3A21A), Cream (#EEE4CC)
   Guaranteed WCAG AA / AAA compliance (> 4.5:1 ratio)
   =================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.35rem;
  font-weight: 700;
  font-size: 0.96rem;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 2px solid transparent;
  line-height: 1.3;
  box-sizing: border-box;
}

/* Primary Solid Gold Button (Black/Navy on Gold, 5.5:1 contrast) */
.btn.solid {
  background: #E3A21A;
  color: #19244F;
  border-color: #D49210;
  box-shadow: 0 2px 6px rgba(25, 36, 79, 0.12);
}

.btn.solid:hover, .btn.solid:focus-visible {
  background: #F0B53A;
  color: #101835;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 14px rgba(227, 162, 26, 0.35);
  border-color: #C2820B;
}

/* Secondary Navy Button (Cream on Navy, 11:1 contrast) */
.btn.ink, .btn.navy {
  background: #19244F;
  color: #FAF8F2;
  border-color: #19244F;
  box-shadow: 0 2px 6px rgba(25, 36, 79, 0.12);
}

.btn.ink:hover, .btn.ink:focus-visible, .btn.navy:hover, .btn.navy:focus-visible {
  background: #243370;
  color: #FFFFFF;
  border-color: #E3A21A;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 14px rgba(25, 36, 79, 0.25);
}

/* Outline Button: High-contrast Navy outline on light backgrounds (13:1 contrast) */
.btn.line {
  background: #FAF8F2;
  color: #19244F;
  border: 2px solid #19244F;
}

.btn.line:hover, .btn.line:focus-visible {
  background: #19244F;
  color: #EEE4CC;
  border-color: #19244F;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 10px rgba(25, 36, 79, 0.15);
}

/* High-contrast Outline Button on Dark/Hero Backgrounds */
.hero .btn.line,
.contact .btn.line,
.dark-sec .btn.line,
.dark .btn.line {
  background: rgba(25, 36, 79, 0.6);
  color: #FAF8F2;
  border: 2px solid #E3A21A;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.hero .btn.line:hover,
.contact .btn.line:hover,
.dark-sec .btn.line:hover,
.dark .btn.line:hover {
  background: #E3A21A;
  color: #19244F;
  border-color: #E3A21A;
  text-shadow: none;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 14px rgba(227, 162, 26, 0.4);
}

/* Unified Classification Search Result Cards */
.classification-result-card {
  background: #FFFFFF;
  border: 1px solid #D5C9A9;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 14px rgba(25, 36, 79, 0.05);
}

.classification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.classification-box {
  background: #FAF8F2;
  border: 1px solid #E4D7B8;
  border-radius: 8px;
  padding: 1.15rem;
  position: relative;
}

.classification-box.gst {
  border-top: 3px solid #10B981;
}

.classification-box.customs {
  border-top: 3px solid #19244F;
}

.classification-box.import {
  border-top: 3px solid #E3A21A;
}

.classification-box.export {
  border-top: 3px solid #F59E0B;
}

.classification-box-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #19244F;
  margin-bottom: 0.65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.duty-rate-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}

/* Manual HSN Selector & Catalogue Browser Modal */
.hsn-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 38, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.hsn-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.hsn-modal-window {
  background: #FFFDF7;
  color: #1B1F33;
  width: 100%;
  max-width: 1100px;
  max-height: 92vh;
  border-radius: 10px;
  box-shadow: 0 24px 50px rgba(10, 16, 38, 0.45);
  border: 1px solid #D5C9A9;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px);
  transition: transform 0.25s ease;
}

.hsn-modal-backdrop.active .hsn-modal-window {
  transform: translateY(0);
}

.hsn-modal-header {
  background: #19244F;
  color: #EEE4CC;
  padding: 1.15rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #E3A21A;
}

.hsn-modal-header h3 {
  margin: 0;
  font-family: "Tiro Devanagari Hindi", serif;
  font-size: 1.4rem;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hsn-modal-close {
  background: transparent;
  border: none;
  color: #EEE4CC;
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
.hsn-modal-close:hover {
  color: #E3A21A;
}

.hsn-modal-body {
  padding: 1.25rem 1.75rem;
  overflow-y: auto;
  flex: 1;
}

.hsn-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: #FAF8F2;
  border: 1px solid #E4D7B8;
  padding: 0.9rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  align-items: flex-end;
}

.hsn-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 140px;
  min-width: 120px;
}

.hsn-filter-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #19244F;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hsn-filter-field input, .hsn-filter-field select {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid #D5C9A9;
  border-radius: 4px;
  background: #FFFFFF;
  color: #1B1F33;
}

.hsn-filter-field input:focus, .hsn-filter-field select:focus {
  outline: none;
  border-color: #E3A21A;
  box-shadow: 0 0 0 3px rgba(227, 162, 26, 0.2);
}

.hsn-table-wrapper {
  overflow-x: auto;
  border: 1px solid #D5C9A9;
  border-radius: 6px;
  background: #FFFFFF;
  max-height: 480px;
}

.hsn-catalog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.hsn-catalog-table th {
  background: #19244F;
  color: #EEE4CC;
  padding: 0.7rem 0.85rem;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 2;
}

.hsn-catalog-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #EFE8D6;
  vertical-align: middle;
}

.hsn-catalog-table tr:hover td {
  background: #FFFDF5;
}

.summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.summary-stat-card {
  background: #FAF8F2;
  border: 1px solid #E4D7B8;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  border-top: 3px solid #19244F;
}

.summary-stat-card.gold { border-top-color: #E3A21A; }
.summary-stat-card.green { border-top-color: #10B981; }
.summary-stat-card.orange { border-top-color: #F59E0B; }

.summary-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: #19244F;
  font-family: "Tiro Devanagari Hindi", serif;
  line-height: 1.1;
  margin-top: 0.2rem;
}

.summary-stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #4B4F66;
  letter-spacing: 0.04em;
}

/* ======================================================
   DEVRATH GOLDEN WHEEL - SMOOTH CONTINUOUS ROTATION
   ====================================================== */

.brand svg,
.devrath-wheel-icon,
svg.wheel-icon,
.wheel-box .wheel {
  animation: devrath-wheel-spin 15s linear infinite;
  transform-origin: center;
  display: inline-block;
  vertical-align: middle;
  will-change: transform;
}

@keyframes devrath-wheel-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Reduced motion accessibility support */
@media (prefers-reduced-motion: reduce) {
  .brand svg,
  .devrath-wheel-icon,
  svg.wheel-icon,
  .wheel-box .wheel {
    animation: none !important;
  }
}


