/**
 * File: css/style.css
 * Path: /farzibank/css/style.css
 * Description: Professional mobile banking app styles with Inter font
 */

/* ===== RESET & BASE STYLES ===== */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  touch-action: manipulation;
  color: white !important;
}

/* ===== MATERIAL SYMBOLS ===== */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}

/* ===== PAGE TRANSITIONS ===== */
.page-view {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
  opacity: 1;
}

.page-view.entering {
  transform: translateX(100%);
  opacity: 0;
}

.page-view.exiting {
  transform: translateX(-100%);
  opacity: 0;
}

/* ===== LOADING STATES ===== */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading .btn-text {
  opacity: 0;
}

.btn-loading .loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 4px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.5);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 0.8);
}

/* ===== BUTTONS ===== */
button {
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  outline: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== FORM ELEMENTS ===== */
input,
textarea,
select {
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

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

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

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

/* ===== UTILITY ANIMATIONS ===== */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.5s ease-out;
}

.animate-pulse-slow {
  animation: pulse 2s ease-in-out infinite;
}

.animate-bounce-subtle {
  animation: bounce 1s ease-in-out infinite;
}

/* ===== CARD HOVER EFFECTS ===== */
.card-hover {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.card-hover:active {
  transform: translateY(0);
}

/* ===== GRADIENT BACKGROUNDS ===== */
.gradient-primary {
  background: linear-gradient(135deg, #10b981, #059669);
}

.gradient-secondary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.gradient-dark {
  background: linear-gradient(135deg, #1f2937, #111827);
}

.gradient-success {
  background: linear-gradient(135deg, #10b981, #047857);
}

.gradient-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* ===== GLASS MORPHISM ===== */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== CUSTOM SHADOWS ===== */
.shadow-soft {
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.1);
}

.shadow-medium {
  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.15);
}

.shadow-strong {
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.25);
}

.shadow-colored {
  box-shadow: 0 4px 16px -4px rgba(16, 185, 129, 0.3);
}

/* ===== TEXT GRADIENTS ===== */
.text-gradient {
  background: linear-gradient(135deg, #10b981, #059669);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-blue {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== LOADING SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  /* Ensure full viewport height on mobile */
  #app {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }

  /* Prevent zoom on focus */
  input, textarea, select {
    font-size: 16px;
  }

  /* Optimize touch targets */
  button, .btn-primary {
    min-height: 44px;
    min-width: 44px;
  }

  /* Better spacing on small screens */
  .container-mobile {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize for retina displays */
  .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  }
}

/* ===== DARK MODE OPTIMIZATIONS ===== */
@media (prefers-color-scheme: dark) {
  /* Additional dark mode optimizations */
  .auto-dark {
    color-scheme: dark;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  /* Hide unnecessary elements when printing */
  .no-print {
    display: none !important;
  }

  /* Optimize colors for printing */
  * {
    background: white !important;
    color: black !important;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  /* Reduce animations for users who prefer less motion */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
.focus-visible:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* ===== ERROR STATES ===== */
.error-field {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px #ef4444;
}

.error-text {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* ===== SUCCESS STATES ===== */
.success-field {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 1px #10b981;
}

.success-text {
  color: #10b981;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* ===== CUSTOM COMPONENTS ===== */

/* Balance Display */
.balance-display {
  font-feature-settings: 'tnum', 'lnum';
  letter-spacing: -0.025em;
}

/* Transaction List */
.transaction-item {
  transition: all 0.2s ease;
  border-radius: 0.75rem;
}

.transaction-item:hover {
  background-color: rgba(55, 65, 81, 0.5);
}

.transaction-item:active {
  transform: scale(0.98);
}

/* Status Badges */
.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* App Container for Desktop */
@media (min-width: 769px) {
  #app {
    max-width: 560px;
    margin: 0 auto;
    border-left: 1px solid #374151;
    border-right: 1px solid #374151;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

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

/* ===== CUSTOM PROPERTIES ===== */
:root {
  --color-primary: #10b981;
  --color-primary-dark: #059669;
  --color-error: #ef4444;
  --color-warning: #f59e0b;
  --color-success: #10b981;
  --color-info: #3b82f6;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
}

/* ===== COMPONENT VARIANTS ===== */
.btn-variant-outline {
  border: 2px solid currentColor;
  background: transparent;
}

.btn-variant-ghost {
  background: transparent;
  border: none;
}

.btn-variant-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ===== LAYOUT UTILITIES ===== */
.safe-area-top {
  padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-left {
  padding-left: env(safe-area-inset-left);
}

.safe-area-right {
  padding-right: env(safe-area-inset-right);
}

/* ===== TEXT COLOR FIX ===== */
/* Ensure all text is visible on dark background */
body,
body *,
.text-white,
h1, h2, h3, h4, h5, h6,
p, span, div, a, button,
.btn, .card {
  color: white !important;
}

/* Specific fixes for common elements */
.text-gray-400 {
  color: rgb(156, 163, 175) !important;
}

.text-gray-300 {
  color: rgb(209, 213, 219) !important;
}

/* Ensure buttons have proper text color */
.btn-primary,
.btn-secondary {
  color: white !important;
}

/* Force button text to be visible unless in loading state */
.btn-text {
  opacity: 1 !important;
  display: flex !important;
}

.btn-loading .btn-text {
  opacity: 0 !important;
  display: none !important;
}

/* Ensure loading spinner is hidden by default */
.loading-spinner {
  display: none !important;
}

.btn-loading .loading-spinner {
  display: flex !important;
}

