
/* --- Modal Styles --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.modal-body {
    padding: 20px;
}

/* Close Button */
.close, .close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close:hover,
.close:focus,
.close-modal:hover,
.close-modal:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Cineom Job Card Specific Styles */
.cineom-job-card-modal {
    max-width: 900px !important;
    width: 95% !important;
    background: #64748b !important; /* Darker background for the modal space */
    padding: 30px !important;
}

.job-card-paper {
    background: white;
    padding: 40px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    color: black;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
    max-width: 800px;
    margin: 0 auto;
}

@media print {
    .job-card-paper {
        padding: 5mm !important;
        transform: scale(0.92);
        transform-origin: top center;
        font-size: 11px !important;
        line-height: 1.2 !important;
    }
    
    .job-card-header {
        margin-bottom: 10px !important;
    }

    .cineom-logo-img {
        height: 45px !important;
    }

    .job-card-title-row {
        margin-top: -20px !important;
        margin-bottom: 10px !important;
    }

    .job-card-main-title {
        font-size: 20px !important;
    }

    .job-card-top-meta {
        border-bottom-width: 1px !important;
    }

    .job-card-grid-section {
        border-width: 1px !important;
    }

    .grid-left-col {
        border-right-width: 1px !important;
        padding: 5px !important;
    }

    .field-row {
        margin-bottom: 4px !important;
    }

    .field-row label {
        font-size: 11px !important;
    }

    .equipment-table th, .equipment-table td {
        padding: 4px !important;
        font-size: 11px !important;
        border-bottom-width: 1px !important;
    }

    .equipment-table th {
        border-right-width: 1px !important;
    }

    .warranty-checkboxes {
        border-width: 1px !important;
        padding: 2px !important;
    }

    .job-card-memo-section {
        border-width: 1px !important;
        padding: 5px !important;
    }
    
    .memo-textarea {
        line-height: 1.3 !important;
        font-size: 11px !important;
    }
    
    .lined-bg {
        background-size: 100% 1.3em !important;
    }

    .job-card-footer-grid {
        border-width: 1px !important;
    }

    .footer-col {
        padding: 5px !important;
    }

    .footer-col:first-child {
        border-right-width: 1px !important;
    }

    .eng-signature-section {
        border-width: 1px !important;
        padding: 10px 5px !important;
    }

    .job-card-bottom-row {
        border-width: 1px !important;
    }

    .bottom-left {
        border-right-width: 1px !important;
        padding: 5px !important;
    }

    .bottom-right {
        padding: 5px !important;
    }
    
    .job-card-grid-section {
        grid-template-columns: 1fr 1fr !important;
    }

    .office-purpose-section {
        margin-top: 5px !important;
    }

    .office-grid {
        gap: 20px !important;
    }

    .office-field {
        margin-bottom: 5px !important;
    }
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.cineom-logo-img {
    height: 60px;
    margin-bottom: 10px;
}

.company-name-header {
    font-weight: bold;
    font-size: 18px;
    color: #000;
}

.company-address-info {
    font-size: 11px;
    text-align: right;
    color: #333;
}

.job-card-title-row {
    text-align: center;
    margin-top: -30px;
    margin-bottom: 20px;
}

.job-card-main-title {
    color: #dc2626; /* Red title */
    font-size: 24px;
    letter-spacing: 2px;
    font-weight: bold;
    margin: 0;
}

.job-card-top-meta {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid black;
    padding-bottom: 5px;
    margin-bottom: 0;
}

.job-card-number-val {
    font-size: 24px;
    font-weight: bold;
    color: #475569;
    margin-left: 20px;
}

.job-card-grid-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 2px solid black;
    border-top: none;
}

.grid-left-col {
    border-right: 2px solid black;
    padding: 10px;
}

.grid-right-col {
    padding: 0;
}

.field-row {
    display: flex;
    margin-bottom: 8px;
    align-items: flex-end;
}

.field-row label {
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
    margin-right: 10px;
}

.inline-input {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px 8px;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.inline-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: #fff;
}

.full-width-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px 8px;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.full-width-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: #fff;
}

.address-row textarea {
    min-height: 60px;
}

.equipment-table {
    width: 100%;
    border-collapse: collapse;
}

.equipment-table th, .equipment-table td {
    border-bottom: 1px solid black;
    padding: 8px;
    text-align: left;
    font-size: 13px;
}

.equipment-table th {
    background: #f8fafc;
    width: 35%;
    border-right: 1px solid black;
}

.equipment-table input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 6px;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
    box-sizing: border-box;
}

.equipment-table input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: #fff;
}

.acc-row {
    display: flex;
    gap: 10px;
}

.acc-row span {
    font-weight: bold;
}

.eng-name-row {
    padding: 10px;
}

.warranty-checkboxes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 2px solid black;
    border-top: none;
    padding: 5px;
}

.check-item {
    font-weight: bold;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.job-card-memo-section {
    border: 2px solid black;
    border-top: none;
    padding: 10px;
}

.memo-title {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 5px;
}

.memo-textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 10px;
    outline: none;
    font-size: 13px;
    line-height: 2;
    transition: all 0.2s ease;
    background: #f8fafc;
    box-sizing: border-box;
}

.memo-textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: #fff;
}

.lined-bg {
    background-image: linear-gradient(#eee 1px, transparent 1px);
    background-size: 100% 2em;
}

.underline-only {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.underline-input {
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
}

.job-card-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 2px solid black;
    border-top: none;
}

.footer-col {
    padding: 10px;
}

.footer-col:first-child {
    border-right: 2px solid black;
}

.eng-signature-section {
    border: 2px solid black;
    border-top: none;
    padding: 20px 10px;
}

.job-card-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 2px solid black;
    border-top: none;
}

.bottom-left {
    border-right: 2px solid black;
    padding: 10px;
}

.bottom-right {
    padding: 10px;
}

.signature-line-long {
    border-bottom: 1px solid black;
    margin-top: 15px;
    width: 80%;
}

.signature-box-small {
    border-bottom: 1px solid black;
    margin-top: 20px;
    width: 100%;
}

.date-underline {
    border-bottom: 1px solid black;
    width: 150px;
    display: inline-block;
    height: 15px;
}

.office-purpose-section {
    margin-top: 10px;
}

.office-title {
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

.office-subtitle {
    text-align: center;
    font-weight: bold;
    text-decoration: underline;
    font-size: 12px;
    margin-bottom: 10px;
}

.office-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.office-field {
    display: flex;
    align-items: flex-end;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: bold;
}

.office-line {
    flex: 1;
    border-bottom: 1px solid black;
    margin-left: 5px;
}

.modal-footer-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 250px;
    overflow-y: auto;
}

.suggestions-dropdown.hidden {
    display: none;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f1f5f9;
    color: #4f46e5;
}

.suggestion-item strong {
    color: #1e293b;
    font-size: 14px;
}

.suggestion-item small {
    color: #64748b;
}

.suggestion-item:hover {
    background: #f1f5f9;
}

.suggestion-item:last-child {
    border-bottom: none;
}

@media print {
    body * {
        visibility: hidden !important;
    }
    #newJobCardModal, #newJobCardModal * {
        visibility: visible !important;
    }
    #newJobCardModal {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: white !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 9999 !important;
    }
    .cineom-job-card-modal {
        background: white !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        margin: 0 !important;
    }
    .job-card-paper {
        box-shadow: none !important;
        padding: 40px !important; /* Keep padding for print margins */
        border: none !important;
    }
    .no-print {
        display: none !important;
    }
}

