/* Global Settings (from ADmanta Labs UI) */
:root {
  --primary-color: #38bdf8;
  --bg-gradient: linear-gradient(135deg, #050505 0%, #0f172a 100%);
  --glass-bg: rgba(20, 20, 20, 0.6);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  --text-main: #ffffff;
  --text-muted: #9ca3af;
  --border-accent: rgba(255, 255, 255, 0.08);

  /* Invoice specific */
  --invoice-accent: #4f46e5;
  /* Deep Indigo Theme */
  --invoice-dark: #1e1e2f;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  margin: 0;
  padding: 0;
  padding-top: 80px;
  color: var(--text-main);
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* ========================================= */
/* NAVBAR SECTION                            */
/* ========================================= */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-accent);
  padding: 15px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-sizing: border-box;
  transition: 0.3s ease-in-out;
}

.navbar .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}

.navbar .logo img {
  height: 52px;
  width: auto;
}

.navbar .logo span {
  background: linear-gradient(to right, #38bdf8, #818cf8, #38bdf8);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shineText 3s linear infinite;
}

@keyframes shineText {
  to {
    background-position: 200% center;
  }
}

.navbar nav {
  display: flex;
  align-items: center;
}

.navbar nav a {
  margin-left: 30px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 15px;
  position: relative;
  transition: color 0.3s;
}

.navbar nav a:hover {
  color: var(--text-main);
}

.navbar nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s ease-in-out;
}

.navbar nav a:hover::after {
  width: 100%;
}

/* ========================================= */
/* MAIN LAYOUT & FORM                        */
/* ========================================= */
.main-wrapper {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  gap: 40px;
  padding: 20px;
  box-sizing: border-box;
}

.form-container {
  flex: 1;
  background: var(--glass-bg);
  padding: 40px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--border-accent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.form-container::-webkit-scrollbar {
  width: 8px;
}

.form-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.form-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.form-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.section-header h2 {
  font-size: 20px;
  color: var(--text-main);
  margin-top: 30px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2 i {
  color: var(--primary-color);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-group label {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 5px;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-accent);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

input:focus,
textarea:focus {
  border-color: var(--primary-color);
  background: rgba(20, 20, 20, 0.8);
  outline: none;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
}

.item-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  border-radius: 8px;
  border: 1px dashed var(--border-accent);
}

.remove-btn {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: none;
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  transition: 0.2s;
}

.remove-btn:hover {
  background: #ef4444;
  color: white;
}

.add-btn {
  background: linear-gradient(to right, #38bdf8, #818cf8);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(56, 189, 248, 0.3);
}

.download-btn {
  background: linear-gradient(to right, #38bdf8, #2563eb);
  color: white;
  padding: 16px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  margin-top: 30px;
  width: 100%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.mobile-btn {
  display: none;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  cursor: pointer;
  font-size: 14px;
}

.checkbox-label input {
  width: auto;
  margin: 0;
  cursor: pointer;
}

/* =========================== */
/* PREVIEW SECTION (DESKTOP)   */
/* =========================== */
.preview-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: sticky;
  top: 100px;
  height: calc(100vh - 120px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 20px;
}

.preview-wrapper {
  width: 100%;
}

.preview-header-bar {
  background: rgba(20, 20, 20, 0.8);
  color: var(--text-muted);
  padding: 10px;
  text-align: center;
  border-radius: 8px 8px 0 0;
  font-size: 14px;
  text-transform: uppercase;
  border: 1px solid var(--border-accent);
  border-bottom: none;
  letter-spacing: 1px;
}

.preview-paper {
  background: white;
  width: 100%;
  padding: 0;
  box-shadow: var(--shadow-lg);
  font-family: 'Arial', sans-serif;
  color: var(--invoice-dark);
  box-sizing: border-box;
  transform: scale(0.95);
  transform-origin: top center;
  margin-bottom: -5%;
  position: relative;
  overflow: hidden;
}

.preview-container::-webkit-scrollbar {
  width: 8px;
}

.preview-container::-webkit-scrollbar-track {
  background: transparent;
}

.preview-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.preview-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* =========================== */
/* INVOICE ACTUAL DESIGN       */
/* =========================== */
.invoice-box {
  padding: 50px 40px;
  position: relative;
  min-height: 100%;
}

/* ─── PAID STAMP (Unique centered design) ─── */
.paid-stamp-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  z-index: 5;
  pointer-events: none;
}

.paid-stamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 5px double #22c55e;
  border-radius: 16px;
  padding: 10px 40px;
  opacity: 0.18;
}

.paid-stamp-text {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 10px;
  color: #22c55e;
  line-height: 1;
  font-family: 'Arial Black', 'Impact', sans-serif;
}

.paid-stamp-date {
  font-size: 13px;
  font-weight: 700;
  color: #22c55e;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ─── HEADER ─── */
.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 35px;
}

.header-left .invoice-logo {
  max-width: 220px;
  max-height: 100px;
  object-fit: contain;
}

.placeholder-logo {
  font-size: 28px;
  font-weight: bold;
  color: #333;
  display: flex;
  align-items: center;
  gap: 10px;
}

.placeholder-logo span {
  color: var(--invoice-accent);
}

.header-right {
  text-align: right;
  font-size: 12px;
  line-height: 1.4;
  color: #333;
}

.header-right h2 {
  font-size: 18px;
  margin: 0 0 5px 0;
  color: #111;
}

.header-right p {
  margin: 2px 0;
}

/* ─── SUMMARY GRID (Client + Invoice meta) ─── */
.invoice-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.invoice-meta-banner {
  background: #f8f9fa;
  padding: 18px;
  border-left: 5px solid var(--invoice-accent);
  border-radius: 4px;
}

.invoice-meta-banner h3 {
  font-size: 20px;
  margin: 0 0 8px 0;
  color: #111;
}

.invoice-meta-banner p {
  margin: 4px 0;
  font-size: 12px;
  color: #333;
}

.balance-due-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bd-label {
  font-size: 13px;
  font-weight: bold;
  color: #333;
}

.bd-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--invoice-accent);
}

.invoice-client {
  font-size: 12px;
  line-height: 1.5;
  background: #fcfcfc;
  padding: 18px;
  border: 1px solid #eee;
  border-radius: 4px;
}

.invoice-client h4 {
  font-size: 13px;
  margin: 0 0 8px 0;
  color: var(--invoice-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── TABLES ─── */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 12px;
}

.invoice-table th,
.invoice-table td {
  padding: 10px 12px;
  border: 1px solid #ddd;
}

.invoice-table th {
  background: #f4f4f4;
  font-weight: bold;
  text-align: left;
  color: #111;
}

.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

.totals-footer td {
  background: #fcfcfc;
}

.totals-footer tr:last-child td {
  background: #f4f4f4;
  font-size: 13px;
}

.transactions-section h3 {
  font-size: 15px;
  margin: 0 0 12px 0;
  border-bottom: 2px solid #eee;
  padding-bottom: 5px;
}

.trans-table tfoot td {
  background: #f4f4f4;
  font-size: 12px;
}

/* ─── TERMS ─── */
.invoice-terms {
  margin-top: 24px;
  padding: 14px;
  background: #fdfdfd;
  border-left: 3px solid #ccc;
  font-size: 11px;
  color: #555;
  line-height: 1.5;
}

.invoice-terms h4 {
  margin: 0 0 5px 0;
  color: #333;
  font-size: 12px;
}

/* ─── FOOTER ─── */
.invoice-footer {
  margin-top: 40px;
  text-align: center;
  font-size: 10px;
  color: #666;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

/* ========================================= */
/* MEDIA QUERIES                             */
/* ========================================= */
@media (max-width: 1024px) {
  .main-wrapper {
    flex-direction: column;
    gap: 30px;
  }

  .form-container {
    max-height: none;
    margin-bottom: 20px;
  }

  .preview-container {
    position: static;
    width: 100%;
    height: auto;
  }

  .preview-paper {
    transform: none;
    margin-bottom: 0;
  }

  .desktop-btn {
    display: none;
  }

  .mobile-btn {
    display: flex;
    margin-top: 20px;
    width: 100%;
    z-index: 10;
  }
}

@media (max-width: 600px) {
  .navbar {
    flex-direction: column;
    padding: 10px 0;
    height: auto;
  }

  .navbar nav {
    margin-top: 10px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 15px;
  }

  .navbar nav a {
    margin: 0 5px;
    font-size: 14px;
  }

  body {
    padding-top: 130px;
  }

  .invoice-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================= */
/* PRINT SPECIFIC STYLES                     */
/* ========================================= */
@media print {

  /* Hide everything we don't want */
  .navbar,
  .form-container,
  .preview-header-bar,
  .mobile-btn,
  .desktop-btn {
    display: none !important;
  }

  body {
    background: none;
    margin: 0;
    padding: 0;
  }

  .main-wrapper {
    padding: 0;
    margin: 0;
    display: block;
  }

  .preview-container {
    height: auto;
    overflow: visible;
    position: static;
    display: block;
    padding: 0;
  }

  .preview-wrapper {
    width: 100%;
  }

  .preview-paper {
    box-shadow: none;
    transform: none;
    margin: 0;
    padding: 0;
  }

  .invoice-box {
    padding: 0;
  }

  /* Force background colors for print */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}