/* ===== GENERAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-size: 11px;
    line-height: 1.3;
    background-color: #f5f5f5;
    color: #000;
}

/* ===== NAVIGATION BAR ===== */
.navbar {
    background-color: #003366;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.navbar h1 {
    font-size: 18px;
    font-weight: bold;
}

.navbar-links {
    display: flex;
    gap: 20px;
}

.navbar-links a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.navbar-links a:hover,
.navbar-links a.active {
    background-color: rgba(255,255,255,0.2);
}

/* ===== EMPLOYEE SELECTOR ===== */
.employee-selector {
    background: #e8f4ff;
    padding: 15px 20px;
    margin-top: 60px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 2px solid #003366;
}

.employee-selector label {
    font-weight: bold;
    color: #003366;
}

.employee-selector select {
    padding: 8px 15px;
    font-size: 14px;
    border: 1px solid #003366;
    border-radius: 4px;
    min-width: 300px;
}

/* ===== CONTAINER ===== */
.container {
    width: 210mm;
    min-height: 297mm;
    margin: 20px auto;
    padding: 10mm 10mm;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.15);
    border: 1px solid #ccc;
}

/* ===== HEADER STYLES ===== */
.header {
    margin-bottom: 10px;
}

.form-info {
    margin-bottom: 5px;
}

.form-info-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 9px;
}

.form-info-left span:first-child {
    font-weight: bold;
}

.header-content {
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    align-items: center;
    gap: 20px;
    margin-bottom: 5px;
}

.logo-box {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-box img {
    max-width: 72px;
    max-height: 72px;
    display: block;
}

.agency-info {
    text-align: center;
    padding: 0 8px;
}

.agency-info .republic {
    font-size: 11px;
}

.agency-info .dept {
    font-size: 12px;
    font-weight: bold;
}

.agency-info .region {
    font-size: 10px;
}

.agency-info h2 {
    font-size: 14px;
    font-weight: bold;
    margin-top: 3px;
}

.stamp-box {
    width: 80px;
    height: 50px;
    border: 1px solid #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    text-align: center;
}

.title {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin: 10px 0;
    text-decoration: underline;
}

/* ===== FORM ROW STYLES ===== */
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.form-row.two-col-wide .form-group:first-child {
    flex: 0.4;
}

.form-row.two-col-wide .form-group:last-child {
    flex: 0.6;
}

.form-row.three-col .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    font-weight: bold;
    font-size: 10px;
    margin-bottom: 3px;
}

.form-group .sub-label {
    font-weight: normal;
    font-style: italic;
    font-size: 9px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"] {
    width: 100%;
    padding: 5px;
    border: 1px solid #000;
    font-size: 11px;
}

.name-inputs {
    display: flex;
    gap: 5px;
}

.name-inputs input {
    flex: 1;
    padding: 5px;
    border: 1px solid #000;
    font-size: 11px;
}

/* ===== SECTION STYLES ===== */
.section-header {
    background: #003366;
    color: white;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 11px;
    margin: 10px 0 5px 0;
}

.two-column-section {
    display: flex;
    border: 1px solid #000;
    margin-bottom: 5px;
}

.column {
    flex: 1;
    padding: 8px;
}

.left-column {
    border-right: 1px solid #000;
}

.column-header {
    font-weight: bold;
    font-size: 10px;
    background: #d9edf7;
    padding: 4px;
    margin-bottom: 8px;
    text-align: center;
}

/* ===== LEAVE TYPES ===== */
.leave-types {
    font-size: 9px;
}

.radio-item, .checkbox-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 3px;
    cursor: pointer;
}

.radio-item input, .checkbox-item input {
    margin-right: 5px;
    margin-top: 2px;
}

.radio-item span, .checkbox-item span {
    flex: 1;
}

.radio-item small, .checkbox-item small {
    display: block;
    font-style: italic;
    color: #555;
    font-size: 8px;
}

.other-field {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.other-field input {
    flex: 1;
    padding: 3px;
    border: 1px solid #000;
}

/* ===== DETAIL SECTIONS ===== */
.detail-section {
    margin-bottom: 10px;
    font-size: 9px;
}

.detail-title {
    font-weight: bold;
    font-size: 9px;
    text-decoration: underline;
    margin-bottom: 5px;
}

.specify-input {
    width: 100%;
    padding: 3px;
    border: 1px solid #000;
    margin-top: 3px;
    margin-bottom: 5px;
    font-size: 9px;
}

/* ===== DATE RANGE PICKER ===== */
.date-range-picker {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.date-field {
    flex: 1;
}

.date-field label {
    font-size: 9px;
    font-weight: bold;
    display: block;
    margin-bottom: 3px;
}

.date-field input[type="date"] {
    width: 100%;
    padding: 5px;
    border: 1px solid #000;
    font-size: 10px;
}

.auto-calc-note {
    font-size: 8px;
    color: #666;
    font-style: italic;
    margin-top: 3px;
}

/* ===== NUMBER OF DAYS & INCLUSIVE DATES ===== */
.full-width-input {
    width: 100%;
    padding: 5px;
    border: 1px solid #000;
    font-size: 11px;
    text-align: center;
}

/* ===== COMMUTATION ===== */
.commutation-options {
    margin-bottom: 20px;
}

/* ===== SIGNATURE AREA ===== */
.signature-area {
    text-align: center;
    margin-top: 15px;
}

.signature-line {
    border-bottom: 1px solid #000;
    width: 80%;
    margin: 0 auto 5px auto;
    height: 25px;
}

.signature-label {
    font-size: 9px;
    font-style: italic;
}

.signature-name {
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
}

.signature-title {
    font-size: 9px;
}

/* ===== CREDITS TABLE ===== */
.as-of {
    font-size: 9px;
    margin-bottom: 5px;
}

.as-of input {
    border: none;
    border-bottom: 1px solid #000;
    width: 100px;
    font-size: 9px;
}

.credits-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9px;
    margin-top: 10px;
}

.credits-table th, .credits-table td {
    border: 1px solid #000;
    padding: 4px;
    text-align: center;
}

.credits-table th {
    background: #f0f0f0;
}

.credits-table input {
    width: 100%;
    border: none;
    text-align: center;
    font-size: 9px;
    padding: 2px;
}

/* ===== RECOMMENDATION ===== */
.recommendation-options {
    font-size: 9px;
}

.inline-input {
    width: 50px;
    border: none;
    border-bottom: 1px solid #000;
    text-align: center;
    padding: 2px;
}

.inline-input-text {
    width: 120px;
    border: none;
    border-bottom: 1px solid #000;
    padding: 2px;
}

/* ===== APPROVED SECTION ===== */
.approved-options {
    font-size: 9px;
}

.approved-options label {
    display: block;
    margin-bottom: 5px;
    font-weight: normal;
}

.small-input {
    width: 40px;
    border: none;
    border-bottom: 1px solid #000;
    text-align: center;
    padding: 2px;
}

/* ===== DISAPPROVAL TEXTAREA ===== */
textarea {
    width: 100%;
    padding: 5px;
    border: 1px solid #000;
    font-size: 9px;
    resize: none;
}

/* ===== FINAL SIGNATURE ===== */
.final-signature {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #000;
}

/* ===== BUTTON STYLES ===== */
.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
}

.btn {
    padding: 12px 30px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit {
    background: #28a745;
    color: white;
}

.btn-submit:hover {
    background: #218838;
}

.btn-print {
    background: #007bff;
    color: white;
}

.btn-print:hover {
    background: #0056b3;
}

.btn-clear {
    background: #dc3545;
    color: white;
}

.btn-clear:hover {
    background: #c82333;
}

/* ===== MODAL STYLES ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
}

.modal-icon {
    font-size: 60px;
    color: #28a745;
    margin-bottom: 15px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
}

/* ===== A4 PRINT STYLES ===== */
@media print {
    /* Hide non-print elements */
    .no-print,
    .navbar,
    .employee-selector,
    .button-group {
        display: none !important;
    }
    
    /* Reset body and page */
    body {
        background: white;
        margin: 0;
        padding: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Page setup for A4 */
    @page {
        size: A4 portrait;
        margin: 10mm;
    }
    
    /* Container sizing for A4 */
    .container {
        width: 190mm;
        min-height: auto;
        margin: 0;
        padding: 5mm;
        box-shadow: none;
        border: none;
        page-break-inside: avoid;
    }
    
    /* Reduce font sizes for print */
    .form-info-left {
        font-size: 8px;
    }
    
    .agency-info .republic {
        font-size: 10px;
    }
    
    .agency-info .dept {
        font-size: 11px;
    }
    
    .agency-info .region {
        font-size: 9px;
    }
    
    .agency-info h2 {
        font-size: 12px;
    }
    
    .title {
        font-size: 14px;
        margin: 8px 0;
    }
    
    .section-header {
        font-size: 10px;
        padding: 4px 8px;
        margin: 8px 0 4px 0;
    }
    
    .column-header {
        font-size: 9px;
        padding: 3px;
    }
    
    .form-group label {
        font-size: 9px;
    }
    
    .form-group input {
        font-size: 10px;
        padding: 3px;
    }
    
    .leave-types,
    .detail-section,
    .recommendation-options,
    .approved-options {
        font-size: 8px;
    }
    
    .radio-item, .checkbox-item {
        margin-bottom: 2px;
    }
    
    .radio-item small, .checkbox-item small {
        font-size: 7px;
    }
    
    .column {
        padding: 5px;
    }
    
    .credits-table {
        font-size: 8px;
    }
    
    .credits-table th, .credits-table td {
        padding: 3px;
    }
    
    .signature-line {
        height: 20px;
    }
    
    .signature-name {
        font-size: 10px;
    }
    
    .signature-title {
        font-size: 8px;
    }
    
    .final-signature {
        margin-top: 10px;
        padding: 10px;
    }
    
    /* Hide date picker icons in print */
    input[type="date"]::-webkit-calendar-picker-indicator {
        display: none;
    }
    
    /* Show input values clearly */
    input, textarea, select {
        background: white !important;
        border: 1px solid #000 !important;
    }
    
    /* Keep backgrounds for headers */
    .section-header {
        background: #003366 !important;
        color: white !important;
    }
    
    .column-header {
        background: #d9edf7 !important;
    }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media screen and (max-width: 800px) {
    .container {
        width: 100%;
        margin: 10px;
        padding: 15px;
    }
    
    .two-column-section {
        flex-direction: column;
    }
    
    .left-column {
        border-right: none;
        border-bottom: 1px solid #000;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .navbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .employee-selector {
        flex-direction: column;
        margin-top: 100px;
    }
    
    .employee-selector select {
        width: 100%;
    }
}
