/* ========== INVOXA · Premium Design System ========== */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --secondary: #7c3aed;
  --success: #10b981;
  --dark: #1f2937;
  --light: #f9fafb;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(145deg, #ffffff 0%, #f8fcff 100%);
  color: var(--dark);
  line-height: 1.5;
  min-height: 100vh;
}

/* ===== GLASSMORPHISM ===== */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 20px -1px rgba(0, 0, 0, 0.03);
}

.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 20px 32px -12px rgba(0, 0, 0, 0.05);
}
.invoice-logo-text {
  font-size: 1.875rem;
  font-weight: 900;
  background: linear-gradient(to right, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #4f46e5; /* Fallback für sehr alte Browser */
}
/* ===== ANIMATIONEN ===== */
@keyframes blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

.animate-blob {
  animation: blob 7s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

.hover-lift {
  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 35px -12px rgba(79, 70, 229, 0.15);
}

/* ===== RECHNUNGSVORSCHAU (A4) ===== */
.invoice-a4 {
  background: white;
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f4f8;
  transition: all 0.25s ease;
  width: 100%;
  max-width: 210mm;
  margin: 0 auto;
  position: relative;
}

.invoice-a4:hover {
  box-shadow: 0 25px 45px -12px rgba(79, 70, 229, 0.12);
  border-color: var(--primary-light);
}

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  white-space: nowrap;
  transition: all 0.15s;
}

.status-badge:hover {
  transform: scale(1.05);
}

/* ===== FEATURE CARDS ===== */
.feature-card {
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(145deg, rgba(79,70,229,0.02) 0%, rgba(124,58,237,0.02) 100%);
  opacity: 0;
  transition: opacity 0.25s;
}

.feature-card:hover::after {
  opacity: 1;
}

/* ===== FORM ELEMENTE ===== */
input, select, textarea {
  transition: all 0.2s ease;
  border: 1px solid #e2e8f0;
  background: white;
  font-size: 0.95rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

button {
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:active {
  transform: scale(0.98);
}

/* ===== POSITIONEN ITEMS ===== */
.position-item {
  background: #f9fafb;
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid #edf2f7;
  transition: all 0.2s;
}

.position-item:hover {
  background: white;
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.05);
}

/* ===== TABS ===== */
.tab-button {
  transition: all 0.2s;
  position: relative;
}

.tab-button.active {
  color: var(--primary);
  font-weight: 600;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* ===== TABELLEN ===== */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

th {
  font-weight: 600;
  color: #4b5563;
  background: #f9fafb;
}

td, th {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #edf2f7;
}

tr:last-child td {
  border-bottom: none;
}

tr {
  transition: background-color 0.15s;
}

tr:hover td {
  background-color: #fafbff;
}

/* ===== BENACHRICHTIGUNGEN ===== */
.notification {
  position: fixed;
  top: 90px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  background: white;
  box-shadow: 0 15px 30px -10px rgba(0,0,0,0.15);
  border-left: 4px solid var(--primary);
  z-index: 9999;
  animation: slideIn 0.3s ease-out;
}
.invoxa-logo {
    font-size: 1.875rem !important;
    font-weight: 900 !important;
    color: #4f46e5 !important; /* Fallback für alte Browser */
    background: linear-gradient(to right, #4f46e5, #7c3aed) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    display: inline-block !important;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== DRUCK-OPTIMIERUNG - RADIKAL VEREINFACHT ===== */
@media print {
    /* ALLES ausblenden - NUR die Rechnung sichtbar */
    header, footer, button, nav, form, .tab-button, .tab-content,
    .bg-white.p-6.rounded-3xl, .lg\\:grid-cols-2 > div:last-child,
    #userMenu, .fixed, .glass, .bg-indigo-600, .flex.items-center.gap-2,
    [onclick], .max-w-7xl > .flex-wrap, .h-20, .py-8, .px-4,
    label, input, select, textarea, .border-t, .border-b:not(.invoice-a4 *),
    .grid:not(.invoice-a4 .grid) {
        display: none !important;
    }
    
    /* Body nur für Rechnung */
    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
    }
    
    /* Hauptcontainer zurücksetzen */
    .max-w-7xl, .mx-auto, .px-4, .sm\:px-6, .py-8, .lg\:grid-cols-2 {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        width: 210mm !important;
    }
    
    /* NUR die Rechnung anzeigen - EXAKT wie PDF */
    .invoice-a4, #invoicePreviewContent, .grid.lg\\:grid-cols-2 > div:first-child {
        display: block !important;
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 210mm !important;
        min-height: 297mm !important;
        padding: 15mm !important;
        margin: 0 auto !important;
        background: white !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
    }
    
    /* Alle inneren Elemente der Rechnung anzeigen */
    .invoice-a4 *,
    #invoicePreviewContent *,
    .space-y-6, .flex, .grid, .border-t, .border-b,
    .font-bold, .text-sm, .text-gray-600, .font-mono {
        display: block !important;
        visibility: visible !important;
    }
    
    /* Flex und Grid korrekt darstellen */
    .flex.justify-between {
        display: flex !important;
    }
    
    .grid.grid-cols-12,
    .grid.grid-cols-3 {
        display: grid !important;
    }
    
    /* Farben für Druck erzwingen */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /* INVOXA Logo im Druck */
.invoxa-logo {
    font-size: 1.875rem !important;
    font-weight: 900 !important;
    color: #4f46e5 !important; /* Fallback für alte Browser */
    background: linear-gradient(to right, #4f46e5, #7c3aed) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    display: inline-block !important;
}
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .invoice-a4 {
    padding: 1.25rem;
  }
  
  table {
    font-size: 0.8rem;
  }
  
  td, th {
    padding: 0.75rem;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}