/* ========== GLOBAL STYLES ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #f2f7fb;
  color: #333;
  padding: 20px;
  font-size: 16px;
}

/* ========== CONTAINER ========== */
.invoice-container {
  max-width: 960px;
  margin: auto;
  background: #fff;
  padding: 30px 40px;
  box-shadow: 0 0 25px rgba(0,0,0,0.05);
  border-radius: 10px;
}

/* ========== HEADER ========== */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

header h1 {
  font-size: 28px;
  color: var(--accent-color, #007B7F);
}

header h2 {
  font-size: 26px;
  color: #444;
}

/* ========== CLIENT DETAILS ========== */
.client-details h3 {
  margin-bottom: 10px;
  color: var(--accent-color, #007B7F);
}

.client-details input {
  display: block;
  margin: 8px 0;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  color: #444;
}

/* ========== ITEMS TABLE ========== */
.invoice-items table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.invoice-items th {
  background: var(--accent-color, #007B7F);
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: normal;
  border-radius: 4px 4px 0 0;
}

.invoice-items td {
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.invoice-items input {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#addItemButton {
  margin-top: 15px;
  padding: 8px 16px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#addItemButton:hover {
  background: #218838;
}

/* ========== TOTALS ========== */
.totals h3 {
  text-align: right;
  font-size: 20px;
  margin-top: 10px;
  color: #000;
}

/* ========== RICH TEXT AREA ========== */
.rich-text {
  border: 1px solid #ccc;
  min-height: 100px;
  padding: 10px;
  background: #fdfdfd;
  border-radius: 6px;
  margin-bottom: 20px;
  color: #333;
}

.rich-text:empty:before {
  content: attr(placeholder);
  color: #999;
}

/* ========== TOOLBAR ========== */
.toolbar {
  margin: 10px 0;
}

.toolbar button,
.toolbar select {
  margin-right: 5px;
  padding: 6px 10px;
  background: #f3f3f3;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  color: #333;
}

.toolbar button:hover,
.toolbar select:hover {
  background: #ddd;
}

/* ========== ACTIONS ========== */
.actions {
  text-align: center;
  margin: 20px 0;
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  font-size: 14px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #eee;
  color: #555;
}

/* ========== PRINT BUTTON ========== */
#printButton {
  background-color: #ff6600;
  color: white;
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin: 20px 0;
}

#printButton:hover {
  background-color: #e55a00;
}

/* ========== DESIGN SWITCHER ========== */
.design-switcher {
  text-align: right;
  margin-bottom: 20px;
}

.design-switcher label {
  font-weight: 600;
  margin-right: 5px;
}

.design-switcher select {
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* ========== THEMES ========== */
.theme-default {
  --accent-color: #007B7F;
}

.theme-modern {
  --accent-color: #0066cc;
}

.theme-dark {
  background: #121212;
  color: #e0e0e0;
}

.theme-dark .invoice-container {
  background: #1f1f1f;
  color: #e0e0e0;
}

.theme-dark input,
.theme-dark .rich-text,
.theme-dark .toolbar button,
.theme-dark .toolbar select,
.theme-dark .design-switcher select {
  background-color: #2b2b2b;
  color: #fff;
  border-color: #555;
}

/* ========== PRINT MEDIA ========== */
@media print {
  body {
    background: white !important;
    color: black !important;
  }

  .design-switcher,
  #addItemButton,
  #printButton,
  .toolbar,
  .actions {
    display: none !important;
  }

  .invoice-container {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 20px !important;
  }

  input {
    border: none !important;
    background: none !important;
    color: black !important;
    font-weight: bold;
  }

  .rich-text {
    border: none !important;
    background: none !important;
    color: black !important;
  }

  button {
    display: none !important;
  }
}
