/* Minimalist bxb-style theme - boxbilling.com inspired */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap');

:root {
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-bg: #ffffff;
  --color-bg-subtle: #fafafa;
  --color-accent: #0f172a;
  --color-accent-muted: #e2e8f0;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--color-text);
}

/* Typography hierarchy - bxb style */
.heading-hero {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--color-text);
}
.heading-section {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.text-body {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}
.text-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Product card description - links, bold visible */
.product-card-desc a { color: #0f172a; font-weight: 600; text-decoration: underline; }
.product-card-desc a:hover { color: #1e293b; }
.product-card-desc strong, .product-card-desc b { font-weight: 700; }
.product-card-desc ul, .product-card-desc ol { padding-left: 1.25rem; margin: 0.5rem 0; }

/* Minimalist buttons - black/white */
.vg-gradient,
.btn-primary {
  background: #0f172a;
  color: white;
}
.btn-primary:hover {
  background: #1e293b;
}
.btn-outline {
  background: white;
  color: #0f172a;
  border: 2px solid #e2e8f0;
}
.btn-outline:hover {
  border-color: #0f172a;
  background: #f8fafc;
}

.glass-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #f1f5f9;
}

/* Screen reader only - skip link */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sr-only:focus {
  position: fixed;
  width: auto;
  height: auto;
  padding: 1rem 1.5rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  z-index: 9999;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Minimalist hover - subtle */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.08);
  border-color: #e2e8f0;
}
.btn-hover {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-hover:hover {
  transform: scale(1.02);
}
.btn-hover:active {
  transform: scale(0.98);
}
.link-underline {
  position: relative;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.2s ease;
}
.link-underline:hover::after {
  width: 100%;
}

/* Toast slide-in */
@keyframes slide-in {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
.animate-slide-in {
  animation: slide-in 0.3s ease-out;
}

/* Minimalist card */
.card-minimal {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card-minimal:hover {
  border-color: #e2e8f0;
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.06);
}

/* Dark mode - applied to html.dark */
html.dark body { background: #0f172a !important; color: #e2e8f0; }
html.dark .bg-white { background: #1e293b !important; }
html.dark .bg-bg-subtle { background: #0f172a !important; }
html.dark .text-slate-800 { color: #e2e8f0; }
html.dark .text-slate-600 { color: #94a3b8; }
html.dark .text-slate-500 { color: #64748b; }
html.dark .border-slate-100 { border-color: #334155; }
html.dark .border-slate-200 { border-color: #334155; }
html.dark .glass-header { background: rgba(15, 23, 42, 0.95) !important; }
html.dark .shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.3); }

/* Tooltip */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 6px 10px;
  background: #1e293b;
  color: white;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 50;
}
[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* AOS fix: opacity 0'da kalma sorunu - içerik her zaman görünür */
[data-aos] {
  opacity: 1 !important;
  visibility: visible !important;
}
@media (prefers-reduced-motion: reduce) {
  [data-aos] {
    transform: none !important;
  }
}

/* ========== UI ENHANCEMENTS ========== */

/* 1. Skeleton loader - enhanced shimmer */
.skeleton, .skeleton-line {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}
.skeleton-line { height: 1rem; }
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 100%; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 2. Page transition */
.page-enter { opacity: 0; transform: translateY(8px); }
.page-enter-active { opacity: 1; transform: translateY(0); transition: opacity 0.3s ease, transform 0.3s ease; }
.page-leave { opacity: 1; }
.page-leave-active { opacity: 0; transition: opacity 0.2s ease; }

/* 3. Button loading state */
.btn-loading { pointer-events: none; position: relative; }
.btn-loading .btn-text { opacity: 0; }
.btn-loading::after {
  content: '';
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  top: 50%;
  left: 50%;
  margin: -0.625rem 0 0 -0.625rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 4. Enhanced hover/focus - focus ring */
.focus-ring:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}
a:focus-visible, button:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

/* 5. Progress bar */
.progress-bar {
  height: 0.5rem;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0f172a, #334155);
  border-radius: 9999px;
  transition: width 0.4s ease;
}
.progress-bar-fill.warning { background: linear-gradient(90deg, #f59e0b, #d97706); }
.progress-bar-fill.danger { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* 6. Table - sticky header & mobile card */
.table-responsive-sticky thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8fafc;
  box-shadow: 0 1px 0 0 #e2e8f0;
}
@media (max-width: 768px) {
  .table-mobile-cards thead { display: none; }
  .table-mobile-cards tr { display: block; border-bottom: 1px solid #e2e8f0; padding: 1rem; }
  .table-mobile-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border: none;
  }
  .table-mobile-cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
  }
  .table-mobile-cards td:last-child { border-bottom: none; }
}

/* 7. Mobile bottom nav */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: white;
  border-top: 1px solid #e2e8f0;
  padding: 0.5rem 0;
  display: none;
  box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.05);
}
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; justify-content: space-around; }
  body.client-area { padding-bottom: 4.5rem; }
}

/* 8. Global search modal */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.search-modal-backdrop.open { opacity: 1; visibility: visible; }
.search-modal {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  width: 90%;
  max-width: 560px;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  z-index: 101;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}
.search-modal.open { opacity: 1; visibility: visible; transform: translateX(-50%) scale(1); }

/* 9. Notification center */
.notification-center {
  position: fixed;
  top: 4rem;
  right: 1rem;
  width: 360px;
  max-height: 80vh;
  overflow-y: auto;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  z-index: 90;
  transform: translateX(120%);
  transition: transform 0.3s ease;
}
.notification-center.open { transform: translateX(0); }

/* 10. Empty state - improved */
.empty-state {
  padding: 3rem 2rem;
  text-align: center;
}
.empty-state-icon {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1.5rem;
  opacity: 0.6;
}

/* 11. Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .skeleton, .skeleton-line { animation: none; background: #e2e8f0; }
  .page-enter, .page-leave-active { transition: none; }
}

/* 12. Print styles */
@media print {
  .glass-header, .mobile-bottom-nav, .mobile-menu, #mobile-offcanvas-backdrop, #back-to-top, #sticky-cta, .search-modal-backdrop, .notification-center, [data-no-print] { display: none !important; }
  body { padding-bottom: 0 !important; }
  .card-minimal { box-shadow: none; border: 1px solid #e2e8f0; }
  a[href]::after { content: none !important; }
}

/* 13. Lazy load placeholder */
img[data-src] { background: #f1f5f9; min-height: 100px; }
img.loaded { background: transparent; }

/* ========== RTL Support (Arabic) ========== */
html[dir="rtl"] body { text-align: right; direction: rtl; }
html[dir="rtl"] main.flex { flex-direction: row-reverse; }
html[dir="rtl"] aside { border-right: none; border-left: 1px solid #e2e8f0; }
html[dir="rtl"] .text-left { text-align: right; }
html[dir="rtl"] .text-right { text-align: left; }
html[dir="rtl"] .border-l-4 { border-left: none; border-right: 4px solid #0f172a; }
html[dir="rtl"] .notification-center { right: auto; left: 1rem; transform: translateX(-120%); }
html[dir="rtl"] .notification-center.open { transform: translateX(0); }
html[dir="rtl"] .search-modal { left: auto; right: 50%; transform: translate(50%, -50%); }
html[dir="rtl"] .search-modal.open { transform: translate(50%, -50%) scale(1); }