/**
 * PDF Generation Stylesheet
 * =========================
 * Dedicated styles for PDF/print output.
 * Used by html2canvas/jsPDF generation to ensure consistent PDF appearance.
 * 
 * These classes replace inline styles for better maintainability.
 */

/* ===== PDF CONTAINER ===== */
.pdf-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    background: white;
    z-index: 9998;
    display: none;
}

.pdf-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 35px;
    background: white;
    color: #1f2937;
    font-family: 'Montserrat', sans-serif;
}

/* ===== PDF HEADER ===== */
.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 2px solid #D4AF37;
    padding-bottom: 24px;
}

.pdf-header-title {
    font-size: 1.875rem;
    font-weight: bold;
    color: #D4AF37;
    margin: 0;
}

.pdf-header-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 4px;
}

.pdf-header-date-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.pdf-header-date-value {
    font-weight: bold;
    font-size: 1.125rem;
    margin: 0;
}

/* ===== PDF FOOTER ===== */
.pdf-footer {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
}

.pdf-footer p {
    margin: 0;
}

/* ===== CLIENT INFORMATION SECTION ===== */
.pdf-client-info {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.pdf-client-info-title {
    font-size: 1rem;
    font-weight: 700;
    color: #D4AF37;
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pdf-client-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.pdf-field-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pdf-field-value {
    margin: 0.25rem 0 0 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

/* ===== DISEASE SECTION ===== */
.pdf-disease-section {
    margin-bottom: 2rem;
}

.pdf-disease-separator {
    margin: 2rem 0;
    border-top: 1px dashed #e5e7eb;
}

.pdf-disease-header {
    margin-bottom: 1.5rem;
}

.pdf-disease-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pdf-disease-title-bar {
    width: 6px;
    height: 24px;
    background: linear-gradient(to bottom, #D4AF37, #fbbf24);
    border-radius: 4px;
    display: inline-block;
}

/* ===== TIME PERIOD SECTION ===== */
.pdf-period-section {
    margin-bottom: 1.5rem;
}

/* Period Headers - Base Styles */
.pdf-period-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    padding: 0.5rem 1rem;
    border-left: 4px solid;
    border-radius: 0 8px 8px 0;
}

/* Morning Period */
.pdf-period-header--morning {
    color: #92400e;
    background-color: #fffbeb;
    border-left-color: #fcd34d;
}

/* Afternoon Period */
.pdf-period-header--afternoon {
    color: #075985;
    background-color: #f0f9ff;
    border-left-color: #7dd3fc;
}

/* Evening Period */
.pdf-period-header--evening {
    color: #5b21b6;
    background-color: #f5f3ff;
    border-left-color: #a78bfa;
}

/* ===== TABLE STYLES ===== */
.pdf-table {
    width: 100%;
    text-align: left;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.pdf-table-header-row {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.pdf-table-th {
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #f3f4f6;
    font-weight: 600;
}

.pdf-table-th--product {
    width: 25%;
}

.pdf-table-th--qty {
    width: 15%;
}

.pdf-table-th--timing {
    width: 25%;
}

.pdf-table-th--note {
    width: 35%;
}

.pdf-table-body {
    font-size: 0.9rem;
}

/* Table Row */
.pdf-table-row {
    page-break-inside: avoid;
}

/* Table Cells */
.pdf-table-td {
    padding: 1rem;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.pdf-table-td--product {
    color: #1f2937;
    font-weight: 600;
}

.pdf-table-td--qty {
    color: #4b5563;
}

.pdf-table-td--timing {
    color: #4b5563;
}

.pdf-table-td--note {
    color: #6b7280;
    font-style: italic;
    white-space: pre-wrap;
    word-break: break-word;
}

.pdf-table-td--border {
    border-bottom: 1px solid #f3f4f6;
}

/* Timing Badge */
.pdf-timing-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* ===== UTILITY CLASSES ===== */
.pdf-text-right {
    text-align: right;
}

.pdf-text-center {
    text-align: center;
}

.pdf-text-gray-800 {
    color: #1f2937;
}

/* ===== PRINT MEDIA QUERY ===== */
@media print {
    .pdf-container {
        display: block !important;
        position: static;
    }

    .pdf-content {
        padding: 0;
        max-width: 100%;
    }

    .pdf-table-row {
        page-break-inside: avoid;
    }

    .pdf-disease-section {
        page-break-inside: avoid;
    }
}