/* ==========================================================================
   ARCHITECTURAL PORTFOLIO STYLESHEET
   Architect: Ar. Deepti Singh | B.Arch, CSVTU Bhilai
   Aesthetic: Contemporary High-End Minimalist Architectural Studio
   Dual Theme Support: Obsidian Dark & Alabaster Light
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables & Theme Definitions
   -------------------------------------------------------------------------- */
:root {
  /* Default: Obsidian Dark Theme */
  --bg-primary: #0a0a0c;
  --bg-secondary: #121216;
  --bg-tertiary: #18181f;
  --bg-card: #121216;
  --bg-card-hover: #181820;
  --bg-glass: rgba(10, 10, 12, 0.85);
  --bg-glass-card: rgba(18, 18, 22, 0.7);
  
  --accent-gold: #c5a880;
  --accent-gold-light: #dfc8a5;
  --accent-gold-dark: #9e7f57;
  --accent-gold-glow: rgba(197, 168, 128, 0.15);
  
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(197, 168, 128, 0.3);
  --grid-line: rgba(255, 255, 255, 0.03);
  --cad-cursor-color: #c5a880;
  --cad-crosshair-color: rgba(197, 168, 128, 0.75);

  --font-serif: 'Cinzel', serif;
  --font-display: 'Syne', sans-serif;
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme: Architectural Linen & Alabaster Paper */
:root.theme-light {
  --bg-primary: #f8f6f0;
  --bg-secondary: #ede9df;
  --bg-tertiary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #faf9f6;
  --bg-glass: rgba(248, 246, 240, 0.9);
  --bg-glass-card: rgba(255, 255, 255, 0.85);
  
  --accent-gold: #9e7949;
  --accent-gold-light: #b89363;
  --accent-gold-dark: #785a30;
  --accent-gold-glow: rgba(158, 121, 73, 0.12);
  
  --text-primary: #18181c;
  --text-secondary: #52525e;
  --text-muted: #71717e;
  
  --border-subtle: rgba(0, 0, 0, 0.09);
  --border-accent: rgba(158, 121, 73, 0.4);
  --grid-line: rgba(0, 0, 0, 0.045);
  --cad-cursor-color: #9e7949;
  --cad-crosshair-color: rgba(158, 121, 73, 0.8);
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  line-height: 1.6;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --------------------------------------------------------------------------
   THEME ADAPTIVE CLASSES
   -------------------------------------------------------------------------- */
.theme-light body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.theme-light .bg-\[\#0a0a0c\] {
  background-color: var(--bg-primary) !important;
}

.theme-light .bg-\[\#121216\] {
  background-color: var(--bg-card) !important;
  border-color: var(--border-subtle) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.theme-light .bg-\[\#0e0e12\] {
  background-color: var(--bg-secondary) !important;
}

.theme-light .bg-\[\#16161c\] {
  background-color: #ede8dc !important;
}

.theme-light .bg-\[\#141418\] {
  background-color: #f2eee4 !important;
}

.theme-light .bg-\[\#08080a\] {
  background-color: #eae5d8 !important;
  color: #55555e !important;
}

.theme-light .text-white {
  color: #19191d !important;
}

.theme-light .text-zinc-300 {
  color: #3f3f46 !important;
}

.theme-light .text-zinc-400 {
  color: #52525b !important;
}

.theme-light .text-zinc-500 {
  color: #71717a !important;
}

.theme-light .border-white\/5,
.theme-light .border-white\/10,
.theme-light .border-white\/15,
.theme-light .border-white\/20 {
  border-color: var(--border-subtle) !important;
}

.theme-light input,
.theme-light select,
.theme-light textarea {
  background-color: #ffffff !important;
  color: #18181c !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

.theme-light input:focus,
.theme-light select:focus,
.theme-light textarea:focus {
  border-color: var(--accent-gold) !important;
}

/* Architectural Grid Background Overlay */
.arch-grid-bg {
  background-image: 
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
}

.blueprint-grid-bg {
  background-color: #0b1524;
  background-image: 
    linear-gradient(to right, rgba(74, 144, 226, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(74, 144, 226, 0.08) 1px, transparent 1px),
    linear-gradient(to right, rgba(74, 144, 226, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(74, 144, 226, 0.18) 1px, transparent 1px);
  background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* Typography Utility */
.font-serif { font-family: var(--font-serif); }
.font-display { font-family: var(--font-display); }
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

/* Technical Dimension Callout Badge */
.cad-dim-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border-accent);
  background: var(--accent-gold-glow);
  color: var(--accent-gold);
  text-transform: uppercase;
}

/* Crosshair Decorator */
.crosshair-corner {
  position: relative;
}
.crosshair-corner::before,
.crosshair-corner::after {
  content: '+';
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-gold);
  opacity: 0.5;
  pointer-events: none;
}
.crosshair-corner::before {
  top: -8px;
  left: -8px;
}
.crosshair-corner::after {
  bottom: -8px;
  right: -8px;
}

/* Card Hover Elevation */
.arch-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.3s ease;
}
.arch-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  border-color: var(--accent-gold);
}
.theme-light .arch-card:hover {
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
}

.arch-card .card-img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.arch-card:hover .card-img {
  transform: scale(1.05);
}

/* ==========================================================================
   AUTOCAD TECHNICAL DRAFTING & PENCIL CURSOR
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
  /* Hide standard cursor on desktop to let the drafting crosshair shine */
  body.enable-cad-cursor,
  body.enable-cad-cursor a,
  body.enable-cad-cursor button,
  body.enable-cad-cursor input,
  body.enable-cad-cursor select,
  body.enable-cad-cursor textarea,
  body.enable-cad-cursor .arch-card {
    cursor: crosshair;
  }
}

.cad-cursor-container {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 999999;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .cad-cursor-container {
    display: block;
  }
}

/* AutoCAD Horizontal Hairline */
.cad-crosshair-h {
  position: absolute;
  top: 50%;
  left: -20px;
  width: 40px;
  height: 1px;
  background: var(--cad-crosshair-color);
  transform: translateY(-50%);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* AutoCAD Vertical Hairline */
.cad-crosshair-v {
  position: absolute;
  left: 50%;
  top: -20px;
  height: 40px;
  width: 1px;
  background: var(--cad-crosshair-color);
  transform: translateX(-50%);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* AutoCAD Central Pickbox */
.cad-pickbox {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border: 1.5px solid var(--cad-cursor-color);
  background: rgba(197, 168, 128, 0.15);
  transition: transform 0.2s ease, width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
}

/* Hovering over clickable element (AutoCAD OSNAP Target) */
.cad-cursor-snap .cad-pickbox {
  width: 16px;
  height: 16px;
  border-color: #ffffff;
  background: var(--accent-gold);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 10px var(--accent-gold);
}

.theme-light .cad-cursor-snap .cad-pickbox {
  border-color: #18181c;
}

/* Live CAD Coordinates Readout Floating Tag */
.cad-coordinates {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(4px);
  color: var(--accent-gold);
  border: 1px solid rgba(197, 168, 128, 0.3);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.theme-light .cad-coordinates {
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-gold-dark);
  border-color: rgba(158, 121, 73, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Architect Drafting Pencil Badge on hover */
.cad-pencil-icon {
  position: absolute;
  top: -24px;
  right: -24px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cad-cursor-snap .cad-pencil-icon {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   BEFORE / AFTER COMPARISON SLIDER
   ========================================================================== */
.comparison-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  user-select: none;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: #000;
}

.comparison-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.comparison-image-wrapper img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.comparison-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  border-right: 2px solid var(--accent-gold);
}

.comparison-overlay img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.comparison-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gold);
  color: #0a0a0c;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  z-index: 20;
  border: 3px solid #ffffff;
  transition: transform 0.15s ease, background-color 0.2s ease;
}
.comparison-handle:hover,
.comparison-handle:active {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--accent-gold-light);
}

.comparison-badge {
  position: absolute;
  bottom: 20px;
  padding: 6px 14px;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 10;
  border-radius: 4px;
  pointer-events: none;
}
.comparison-badge.badge-left { left: 20px; }
.comparison-badge.badge-right { right: 20px; }

.comparison-range {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 30;
  margin: 0;
}

/* ==========================================================================
   LIGHTBOX & MODAL
   ========================================================================== */
.modal-backdrop {
  backdrop-filter: blur(16px);
  background: rgba(8, 8, 10, 0.88);
}

.theme-light .modal-backdrop {
  background: rgba(24, 24, 28, 0.75);
}

/* Filter Tab Indicator */
.filter-btn {
  position: relative;
  transition: all 0.25s ease;
}
.filter-btn.active {
  background-color: var(--accent-gold) !important;
  color: #0a0a0c !important;
  font-weight: 600;
}

/* Navigation Blur */
.nav-scrolled {
  background: var(--bg-glass) !important;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Pulse animation for live badge */
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.96); }
}
.pulse-badge {
  animation: pulse-subtle 2.5s infinite ease-in-out;
}
