/* Base styles */
:root {
  --color-primary: #1d2d35;
  --color-secondary: #2d91ff;
  --color-accent: #6a0dad; /* Purple for gradient */
  --color-background: #FFF2/* Add item button styling */
#add-item-btn {
  background: linear-gradient(to right, var(--color-secondary), var(--color-accent));
  color: white;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}surface: #ffffff;
  --color-text: #1d2d35;
  --color-text-secondary: #666666;
  --font-heading: "Quicksand", sans-serif;
  --font-body: "Quicksand", sans-serif;
}

/* General Styles */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

h1 {
    grid-column: 1 / -1;
    text-align: center;
    color: #333;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
}

/* Navigation */
nav {
  background-color: white;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1rem 2rem;
  margin: 1rem auto;
  max-width: 90%;
}

nav a {
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--color-text);
  text-decoration: none;
}

/* Mobile Menu */
#mobile-menu {
    background-color: white;
    padding: 1rem;
    border-radius: 1rem;
    margin-top: 0.5rem;
}

#mobile-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

#mobile-menu a:hover {
    background-color: #f8f9fa;
    color: var(--color-secondary);
}

/* Hamburger Menu Button */
#hamburger-menu {
    border: none;
    background: transparent;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

#hamburger-menu:hover {
    background-color: #f8f9fa;
}

/* Custom button styles */
.btn-primary {
  background-color: var(--color-secondary);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: #1a7ee6;
  transform: translateY(-1px);
}

.btn-secondary {
  color: var(--color-primary);
  font-weight: 600;
}

/* Form elements */
input, textarea, select {
  border: 2px solid #e5e5e5;
  border-radius: 1.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.2s ease;
  background-color: #f8fafc;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

textarea {
  padding: 0.5rem 0.5rem !important;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(45, 145, 255, 0.15);
  outline: none;
  background-color: white;
}

/* Form Styles */
.form-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select,
button {
    height: 36px;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea {
    width: 100%;
}

textarea {
    height: 60px;
    resize: vertical;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background-color: #45a049;
}

/* Items section */
.item-row {
  background-color: var(--color-surface);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.item-row:hover {
  border-color: var(--color-secondary);
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 40px;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.delete-item-btn {
    width: 36px;
    height: 36px;
    background-color: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.delete-item-btn::before {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.delete-item-btn:hover {
    background-color: #f5f5f5;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 12px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 6px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 6px;
  border: 3px solid #f1f1f1;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* File upload button */
input[type="file"]::file-selector-button {
  background: linear-gradient(to right, var(--color-secondary), var(--color-accent));
  border: none;
  border-radius: 9999px;
  color: white;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  margin-right: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input[type="file"]::file-selector-button:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Add item button */
#add-item-btn {
  background: linear-gradient(to right, var(--color-secondary), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: white;
  border: 2px solid transparent;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border-radius: 999px;
  padding: 0.5rem 1.5rem;
  transition: all 0.2s ease;
}

#add-item-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Download button */
#download-pdf-btn {
  background: linear-gradient(to right, var(--color-secondary), var(--color-accent));
  border: none;
  border-radius: 999px;
  color: white;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#download-pdf-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}


/* Form section */
form {
  background-color: var(--color-surface);
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

/* Form labels */
.block.text-sm.font-medium.text-gray-700 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

/* Form section styling */
.custom-scrollbar {
  background: linear-gradient(to bottom right, #ffffff, #f8fafc);
  border-radius: 2rem !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}

/* Section headings */
.text-lg.font-semibold.text-gray-800 {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

/* Invoice Preview Styles */
.preview-container {
    width: 210mm;  /* A4 width */
    min-height: 297mm; /* A4 height */
    padding: 20mm;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    font-family: open-sans, sans-serif !important;
    letter-spacing: 0.1em;;
}

#invoice-preview {
    position: relative;
    background: white;
    color: #333;
}

/* Handle long text */
.break-words {
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.whitespace-pre-line {
    white-space: pre-line;
}

/* Table Styles */
#invoice-preview table {
    border-collapse: collapse;
    width: 100%;
}

#invoice-preview th {
    background-color: #f8f9fa;
    font-weight: 400;
    padding: 8pt;
    color: #444;
}

#invoice-preview td {
    padding: 8pt;
    border-bottom: 1pt solid #eee;
    vertical-align: top;
}

#invoice-preview td:not(:first-child) {
    text-align: right;
}

/* Print styles */
@media print {
    body {
        margin: 0;
        padding: 0 !important;
        background: white;
    }
    
    .preview-container {
        box-shadow: none;
        margin: 0;
        padding: 20mm;
        width: 210mm;
        min-height: 297mm;
        page-break-after: always;
    }
    
    @page {
        size: A4;
        margin: 0;
    }
}

/* Responsive Layout */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    nav {
        margin: 0.5rem 1rem;
        padding: 0.75rem 1.25rem;
    }

    .custom-scrollbar {
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .mx-4 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .preview-container {
        transform: scale(0.8);
        transform-origin: top center;
    }

    #invoice-preview {
        padding: 10mm;
    }

    /* Center form on mobile */
    .flex.flex-col.lg\:flex-row {
        align-items: center;
    }

    /* Adjust spacing for mobile */
    .mt-24 {
        margin-top: 1rem !important;
    }

    /* Full width form on mobile */
    .w-full.lg\:w-1\/2 {
        width: 100% !important;
        padding: 1rem !important;
    }

    /* Stack form elements on mobile */
    .grid.grid-cols-1.md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}
