/* styles.css - Old Oak Renovations Theme */

/* ==========================================================================
   THEME CONFIGURATION - Old Oak Renovations
   ========================================================================== */
:root {
  /* ---------------- COLORS ---------------- */
  --primary-color: #3e2b22;      /* Deep Coffee - Headers, Accents */
  --accent-color: #5d6e38;       /* Forest/Moss Green */
  --accent-hover: #455229;       /* Darker Green */
  
  --bg-white: #fdfbf5;           /* Main Background */
  --bg-light: #f8f5ed;           /* Secondary Background */
  --bg-dark: #2a1f1d;            /* Dark Sections */
  
  --text-dark: #2a1f1d;          /* Body Text */
  --text-light: #5c504a;         /* Muted Text */
  --text-white: #ffffff;         /* Light Text */
  
  --success-color: #5d6e38;      /* Brand Green */
  --error-color: #a63737;        /* Brick Red */
  --warning-color: #c9941a;      /* Warm Gold */
  --border-color: #d6d0c5;       /* Warm Beige */
  
  /* ---------------- TYPOGRAPHY ---------------- */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  
  /* ---------------- SHADOWS ---------------- */
  --shadow-soft: 0 4px 6px -1px rgba(42, 31, 27, 0.1), 0 2px 4px -1px rgba(62, 43, 34, 0.06);
  --shadow-hover: 0 10px 15px -3px rgba(62, 43, 34, 0.12), 0 4px 6px -2px rgba(62, 43, 34, 0.06);
  --shadow-deep: 0 25px 50px -12px rgba(62, 43, 34, 0.25);
  
  --border-radius: 4px;
  --transition-fast: 0.3s ease;
}

/* ==========================================================================
   GLOBAL RESETS & BASE STYLES
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-white);
  color: var(--text-dark);
  line-height: 1.6;
}

/* ==========================================================================
   WATERMARK STYLES
   ========================================================================== */
.watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 6rem;
  font-weight: bold;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
  font-family: var(--font-heading);
}

.watermark-paid {
  color: var(--success-color);
}

.watermark-pending {
  color: var(--warning-color);
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }
  
  #invoicePreview,
  #invoicePreview * {
    visibility: visible;
  }
  
  #invoicePreview {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  
  .watermark {
    display: block !important;
    opacity: 0.08;
  }
  
  #invoicePreview {
    color: #000 !important;
  }
  
  img[alt="Old Oak Logo"] {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  
  .page-break {
    page-break-after: always;
  }
  
  @page {
    margin: 0.5in;
  }
  
  table {
    page-break-inside: avoid;
  }
  
  tr {
    page-break-inside: avoid;
  }
}

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

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   MARKDOWN PREVIEW
   ========================================================================== */
.markdown-preview {
  line-height: 1.6;
}

.markdown-preview ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.markdown-preview li {
  margin: 0.25rem 0;
}

.markdown-preview strong {
  font-weight: 700;
  color: var(--primary-color);
}

.markdown-preview em {
  font-style: italic;
}

/* ==========================================================================
   INVOICE PREVIEW POSITIONING
   ========================================================================== */
#invoicePreview {
  position: relative;
  min-height: 11in;
}

#watermark {
  z-index: 0;
}

#invoicePreview > div {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */
@media (max-width: 768px) {
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
  
  table {
    font-size: 0.875rem;
  }
}

/* ==========================================================================
   BUTTON EFFECTS
   ========================================================================== */
button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:active::before {
  width: 300px;
  height: 300px;
}

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */
.status-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: fadeIn 0.3s ease-in;
}

/* ==========================================================================
   CARD EFFECTS
   ========================================================================== */
.card-shadow {
  box-shadow: var(--shadow-soft);
  transition: box-shadow var(--transition-fast);
}

.card-shadow:hover {
  box-shadow: var(--shadow-hover);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast {
  animation: slideIn 0.3s ease-out;
  font-family: var(--font-body);
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */
input:focus,
textarea:focus,
select:focus {
  outline: none;
}

/* ==========================================================================
   LINE ITEM CARDS
   ========================================================================== */
.line-item-card {
  transition: all 0.2s ease;
}

.line-item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* ==========================================================================
   MODAL BACKDROP
   ========================================================================== */
.modal-backdrop {
  backdrop-filter: blur(4px);
}

/* ==========================================================================
   CHART CONTAINER
   ========================================================================== */
canvas {
  max-height: 400px;
}