/**
 * Custom Styles
 *
 * Additional styles not covered by Tailwind CSS
 */

/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Global Styles */
* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Body flex layout is handled by Tailwind classes in index.php */

/* Navigation Active State */
.nav-link {
    color: #6B7280;
}

.nav-link:hover {
    background-color: #F3F4F6;
    color: #1F2937;
}

.nav-link.active {
    background-color: #3B82F6;
    color: #FFFFFF;
}

.nav-link.active:hover {
    background-color: #2563EB;
}

/* Mobile Menu */
#sidebar.open {
    transform: translateX(0);
}

#mobileMenuOverlay.show {
    display: block;
}

/* Print Styles */
@media print {
    /* Hide navigation and UI elements */
    nav, footer, button, .no-print {
        display: none !important;
    }

    /* Reset page margins */
    @page {
        margin: var(--print-margin-top, 5mm) var(--print-margin-right, 5mm) var(--print-margin-bottom, 5mm) var(--print-margin-left, 5mm);
    }

    body {
        margin: 0;
        padding: 0;
    }

    /* Page breaks */
    .print-page-break {
        page-break-after: always;
    }

    .print-avoid-break {
        page-break-inside: avoid;
    }

    /* Print note styles */
    .print-note {
        border: 1px solid #000;
        padding: 10mm;
        margin-bottom: 5mm;
        font-size: 11pt;
        line-height: 1.4;
    }

    .print-note:last-child {
        margin-bottom: 0;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3B82F6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Status Icons */
.status-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Rich Text Editor Toolbar */
.editor-toolbar {
    border-bottom: 1px solid #e5e7eb;
    padding: 8px;
    background-color: #f9fafb;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.editor-toolbar button {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-toolbar button:hover {
    background-color: #f3f4f6;
}

.editor-toolbar button.active {
    background-color: #3B82F6;
    color: white;
    border-color: #3B82F6;
}

/* Template Line Fields */
.template-field {
    display: inline-block;
    margin: 0 2px;
    vertical-align: middle;
}

.template-field.text-field {
    /* Immutable text */
}

.template-field.textbox-field input,
.template-field.textbox-field textarea {
    border: 1px solid #d1d5db;
    padding: 4px 8px;
    border-radius: 4px;
}

.template-field.textbox-field.small input {
    width: 5ch;
}

.template-field.textbox-field.medium input {
    width: 20ch;
}

.template-field.textbox-field.large textarea {
    width: 100%;
    min-height: 3em;
}

.template-field.dropdown-field select {
    border: 1px solid #d1d5db;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: white;
}

/* Content Container - Left Align Instead of Center */
.container {
    margin-left: 0 !important;
    margin-right: auto !important;
    max-width: 1200px !important; 
}

/* Responsive Utilities */
@media (max-width: 1023px) {
    body {
        flex-direction: column;
    }
}
