/**
 * Home Page CSS Architecture
 * Modular and scalable styles for the home page
 */

/* Animation Classes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animation Utility Classes */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.4s ease-out forwards;
}

/* Component-specific animations */
.hero-content {
  animation-delay: 0.1s;
}

.hero-dashboard {
  animation-delay: 0.2s;
}

.feature-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark .feature-card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

/* Responsive Design Utilities */
@media (max-width: 640px) {
  .hero-title {
    font-size: 2.5rem;
    line-height: 1.1;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.6;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
  }
}

/* Background: Option 01 Fluid Mesh (dark mode) */
@keyframes bgfx-blob {
  0% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(40px, -60px) scale(1.15);
  }
  66% {
    transform: translate(-30px, 30px) scale(0.85);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes bgfx-blob-reverse {
  0% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-40px, 60px) scale(1.25);
  }
  66% {
    transform: translate(30px, -30px) scale(0.75);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

.bgfx-fluid-blob-a {
  animation: bgfx-blob 8s ease-in-out infinite;
}

.bgfx-fluid-blob-b {
  animation: bgfx-blob-reverse 10s ease-in-out infinite;
}

.bgfx-fluid-blob-c {
  animation: bgfx-blob 12s ease-in-out infinite;
}

.bgfx-fluid-blob-d {
  animation: bgfx-blob-reverse 11s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .bgfx-fluid-blob-a,
  .bgfx-fluid-blob-b,
  .bgfx-fluid-blob-c,
  .bgfx-fluid-blob-d {
    animation: none;
  }
}

/* Performance Optimizations */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Focus Management */
.focus-visible:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* UNO Premium Card Styles */
:root{
  --uno-1:#3b82f6;
  --uno-2:#7c3aed;
  --uno-3:#ff7a59;
  --card-w:340px;
  --card-h:210px;
  --radius:16px;
  --text-strong:#ffffff;
}

/* card container */
.premium-card-container {
  perspective: 1000px;
}

.card {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--radius);
  position: relative;
  box-shadow: 0 14px 40px rgba(6,11,21,0.35);
  overflow: hidden;
  background: linear-gradient(135deg, var(--uno-1) 0%, var(--uno-2) 45%, var(--uno-3) 100%);
  color: var(--text-strong);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  border: 1px solid rgba(255,255,255,0.06); /* subtle rim */
}

/* subtle diagonal texture (very low opacity) */
.card::before{
  content:"";
  position:absolute;
  inset:0;
  background-image: linear-gradient(45deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 14px 14px;
  mix-blend-mode: overlay;
  pointer-events:none;
}

/* gloss highlight */
.card::after{
  content:"";
  position:absolute;
  left:-20%;
  top:-40%;
  width:160%;
  height:60%;
  transform: rotate(-18deg);
  background: linear-gradient(90deg, rgba(255,255,255,0.18), rgba(255,255,255,0.02));
  filter: blur(8px);
  opacity:0.9;
  pointer-events:none;
}

/* content layout */
.card-inner{
  padding:22px;
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

/* top row */
.card-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
}

/* UNO logo (left) */
.uno-logo{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:600;
  font-size:14px;
  letter-spacing:0.6px;
  text-transform:uppercase;
  color:rgba(255,255,255,0.96);
}

/* chip */
.chip {
  width:52px;
  height:40px;
  border-radius:4px;
  background: linear-gradient(180deg,#d7dbe0,#f6f7f9);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08) inset;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:6px;
}

/* card number */
.card-number{
  font-size:20px;
  font-weight:600;
  letter-spacing:2px;
  margin-top:6px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.18);
}

/* bottom row text */
.card-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  font-size:12px;
  color:rgba(255,255,255,0.92);
}

.cardholder{
  text-transform:uppercase;
  font-weight:600;
  font-size:13px;
}

/* small rounded contactless icon */
.contactless{
  width:28px; height:18px; display:inline-block;
}

/* subtle emboss for logo */
.emboss{
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.12));
  opacity:0.98;
}

/* hover micro-interaction for UI prototypes */
.card-wrap{
  display:inline-block;
  perspective:1000px;
}
.card-wrap:hover .card{
  transform: translateY(-8px) rotateX(6deg) rotateY(-6deg);
  transition: transform 260ms cubic-bezier(.2,.8,.2,1);
}
.card{
  transition: transform 260ms cubic-bezier(.2,.8,.2,1);
  transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
  .card-wrap:hover .card,
  .card {
    transform: none;
    transition: none;
  }
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-break {
    page-break-before: always;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .border-zinc-200 {
    border-color: #000;
  }
  
  .dark .border-white\/10 {
    border-color: #fff;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .animate-slide-in-left,
  .animate-slide-in-right,
  .animate-scale-in {
    animation: none;
  }
  
  .feature-card {
    transition: none;
  }
}

/* Component Loading States */
.component-loading {
  opacity: 0.6;
  pointer-events: none;
}

.component-loaded {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

/* Error States */
.component-error {
  border: 2px dashed #ef4444;
  background-color: #fef2f2;
  color: #dc2626;
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: center;
}

.dark .component-error {
  background-color: #1f2937;
  border-color: #f87171;
  color: #fca5a5;
}

/* Success States */
.component-success {
  border: 2px solid #10b981;
  background-color: #f0fdf4;
  color: #059669;
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: center;
}

.dark .component-success {
  background-color: #064e3b;
  border-color: #34d399;
  color: #6ee7b7;
}
