/* Custom Font Loading - Local Fonts */

/* Vazirmatn - Variable Font */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn/Vazirmatn[wght].woff2') format('woff2-supports-variations'),
       url('/fonts/Vazirmatn/Vazirmatn[wght].woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Fallback static definitions for Vazirmatn (ensuring maximum compatibility) */
@font-face {
  font-family: 'Vazirmatn-Static';
  src: url('/fonts/Vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn-Static';
  src: url('/fonts/Vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn-Static';
  src: url('/fonts/Vazirmatn/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn-Static';
  src: url('/fonts/Vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* JetBrains Mono */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono/JetBrainsMono-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Righteous */
@font-face {
  font-family: 'Righteous';
  src: url('/fonts/Righteous/righteous-latin-400-normal.woff2') format('woff2'),
       url('/fonts/Righteous/righteous-latin-400-normal.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Space Grotesk - Variable */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/SpaceGrotesk/SpaceGrotesk[wght].woff2') format('woff2-supports-variations'),
       url('/fonts/SpaceGrotesk/SpaceGrotesk[wght].woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* Fallback static for Space Grotesk */
@font-face {
  font-family: 'Space Grotesk-Static';
  src: url('/fonts/SpaceGrotesk/SpaceGrotesk-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk-Static';
  src: url('/fonts/SpaceGrotesk/SpaceGrotesk-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk-Static';
  src: url('/fonts/SpaceGrotesk/SpaceGrotesk-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --vazir-font: 'Vazirmatn', 'Vazirmatn-Static', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono-font: 'JetBrains Mono', 'Fira Code', monospace;
}

body {
  font-family: var(--vazir-font);
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.dark body {
  background-color: #0a0a0b !important;
}

/* Base custom classes to support Persian RTL and English LTR cleanly */
[dir="rtl"] {
  font-feature-settings: "ss01" on;
}

/* Custom card shadow/glow in dark mode */
.dark .service-card {
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.7);
  background-color: #121214 !important;
  border-color: #1e293b !important;
}

.service-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
  transform: translateY(-4px);
}

/* Terminal component design styling */
.terminal-window {
  font-family: var(--mono-font);
}

.terminal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.dark ::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 4px;
}

/* Image Screenshot placeholder styling */
.screenshot-placeholder {
  background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
  position: relative;
  overflow: hidden;
}

.screenshot-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  animation: shine 8s infinite linear;
}

@keyframes shine {
  0% { left: -150%; }
  50% { left: 150%; }
  100% { left: 150%; }
}

/* MATRIX EASTER EGG STYLES */
body.matrix-theme {
  background-color: #000000 !important;
  color: #00ff00 !important;
  font-family: var(--mono-font) !important;
  background-image: 
    linear-gradient(rgba(0, 255, 0, 0.05) 50%, rgba(0, 0, 0, 0.1) 50%),
    linear-gradient(90deg, rgba(0, 255, 0, 0.02), rgba(0, 0, 0, 0.05) 30%, rgba(0, 255, 0, 0.02) 60%);
  background-size: 100% 4px, 6px 100%;
}

body.matrix-theme * {
  color: #00ff00 !important;
  border-color: #00ff00 !important;
  box-shadow: none !important;
  text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff00;
}

/* Apply JetBrains Mono to all elements except FontAwesome icons */
body.matrix-theme *:not(i):not([class*="fa-"]):not([class*="far"]):not([class*="fas"]) {
  font-family: var(--mono-font) !important;
}

/* Most elements are transparent in Matrix theme */
body.matrix-theme *:not(header):not(header *):not(#matrix-easter-egg-overlay):not(#matrix-easter-egg-overlay *):not(#details-modal *):not(#details-modal > div):not(#image-lightbox *):not(#image-lightbox) {
  background-color: transparent !important;
}

body.matrix-theme button, 
body.matrix-theme select, 
body.matrix-theme input, 
body.matrix-theme a {
  border: 1px solid #00ff00 !important;
  color: #00ff00 !important;
  transition: all 0.2s ease;
  cursor: pointer;
}

body.matrix-theme button:hover, 
body.matrix-theme a:hover {
  background-color: #00ff00 !important;
  color: #000000 !important;
  text-shadow: none !important;
}

/* Specific Solid Overrides for Overlapping Layout Containers in Matrix Mode */
body.matrix-theme header,
body.matrix-theme header * {
  background-color: #000000 !important;
}

body.matrix-theme header {
  border-bottom: 1px solid #00ff00 !important;
}

body.matrix-theme #theme-toggle-btn {
  display: none !important;
}

body.matrix-theme #matrix-easter-egg-overlay,
body.matrix-theme #matrix-easter-egg-overlay * {
  background-color: #000000 !important;
}

body.matrix-theme #matrix-easter-egg-overlay {
  border-top: 1px solid #00ff00 !important;
  border-bottom: none !important;
}

body.matrix-theme #details-modal > div,
body.matrix-theme #details-modal > div * {
  background-color: #000000 !important;
}

body.matrix-theme #details-modal > div {
  border: 1px solid #00ff00 !important;
}

body.matrix-theme #image-lightbox,
body.matrix-theme #image-lightbox * {
  background-color: rgba(0, 0, 0, 0.95) !important;
}

/* Rain Effect Background */
#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -10;
  opacity: 0.15;
  pointer-events: none;
  display: none;
}

body.matrix-theme #matrix-canvas {
  display: block;
}

/* Shimmer load states */
.shimmer {
  background: linear-gradient(90deg, #f4f4f5 25%, #e4e4e7 50%, #f4f4f5 75%);
  background-size: 200% 100%;
  animation: shimmer-animation 1.5s infinite;
}

.dark .shimmer {
  background: linear-gradient(90deg, #18181b 25%, #27272a 50%, #18181b 75%);
  background-size: 200% 100%;
  animation: shimmer-animation 1.5s infinite;
}

@keyframes shimmer-animation {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 140px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -70px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}
