/* test/style.css */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    padding: 10px;
    background-color: #f0f2f5; /* Facebook-like light gray background */
    color: #1c1e21; /* Standard dark text color */
    line-height: 1.6;
    font-size: 16px; /* Base font size */
}

.container {
    max-width: 700px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    color: #1c1e21;
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
}
h1 { font-size: 1.8em; font-weight: 600;}
h2 { font-size: 1.5em; font-weight: 500;}
h3 { font-size: 1.25em; font-weight: 500;}

/* Landing Page Specific */
.landing-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 40px;
}
.landing-buttons .btn {
    padding: 15px 20px;
    font-size: 1.2em;
    font-weight: 500;
}

/* General Button Styles */
.btn {
    display: inline-block;
    background-color: #1877f2; /* Primary blue */
    color: #fff;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1em;
    font-weight: 500;
    line-height: 1.25;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    width: 100%; /* Mobile-first: full width */
    box-sizing: border-box;
    margin-bottom: 10px;
    text-align: center;
}
.btn:hover {
    background-color: #166fe5; /* Darker on hover */
}
.btn:active {
    background-color: #1565c0; /* Even darker when pressed */
    transform: translateY(1px);
}
.btn:last-child { margin-bottom: 0; } /* No bottom margin for the last button in a group */

.btn.btn-inline { /* For buttons that shouldn't be full width */
    width: auto;
    margin-right: 10px; /* Spacing for inline buttons */
}
.btn.btn-inline:last-child { margin-right: 0; }

.btn-secondary { background-color: #e4e6eb; color: #050505; }
.btn-secondary:hover { background-color: #d8dbdf; }
.btn-danger { background-color: #fa383e; }
.btn-danger:hover { background-color: #e02020; }
.btn-info { background-color: #17a2b8; } /* Usually a teal/cyan */
.btn-info:hover { background-color: #138496; }
.btn-warning { background-color: #ffc107; color: #212529; }
.btn-warning:hover { background-color: #e0a800; }

.btn-sm { padding: 6px 12px; font-size: 0.9em; }

/* Form Sections & Steps */
.form-header {
    margin-bottom: 25px; padding-bottom: 15px;
    border-bottom: 1px solid #dddfe2; position: relative;
}
.form-header .back-link {
    position: absolute; top: 5px; right: 0;
    font-size: 0.9em; color: #1877f2; text-decoration: none;
}
.form-header .back-link:hover { text-decoration: underline; }

#instructionMessage {
    font-style: normal; color: #606770; margin-bottom: 20px;
    background-color: #f0f2f5; padding: 12px 15px;
    border-left: 4px solid #1877f2; border-radius: 4px; font-size: 0.95em;
}

.step-section {
    display: none; padding: 20px; border: 1px solid #dddfe2;
    border-radius: 6px; margin-bottom: 25px; background-color: #ffffff;
}
.step-section.active { display: block; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; margin-bottom: 6px; font-weight: 500;
    color: #606770; font-size: 0.9em;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%; padding: 10px 12px; border: 1px solid #ccd0d5;
    border-radius: 6px; box-sizing: border-box; font-size: 1em; line-height: 1.25;
}
.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    border-color: #1877f2; box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2); outline: none;
}

.form-group .inline-input-container { display: flex; align-items: center; gap: 8px; }
.form-group .inline-input-container input[type="text"] { flex-grow: 1; }
.form-group .inline-input-container .btn { width: auto; flex-shrink: 0; margin-bottom: 0; margin-left: 0; }

.form-group input[type="text"].prefix-other-input { margin-top: 8px; }

.form-actions {
    margin-top: 25px; text-align: center;
    display: flex; flex-direction: column; gap: 10px;
}
.form-actions .btn { margin-right: 0; }

/* Modal Styles */
.modal {
    display: none; position: fixed; z-index: 1050;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto; background-color: rgba(0,0,0,0.5);
}
.modal-content {
    background-color: #fff; margin: 10vh auto; padding: 20px; border: none;
    width: 90%; max-width: 500px; border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); position: relative;
    display: flex; flex-direction: column;
}
.modal-header {
    padding: 10px 0 15px 0; border-bottom: 1px solid #dddfe2; margin-bottom: 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { margin: 0; font-size: 1.3em; font-weight: 600; color: #050505; text-align: left; }
.modal-body { flex-grow: 1; padding-bottom: 15px; }
.modal-footer {
    padding-top: 15px; border-top: 1px solid #dddfe2; margin-top: auto;
    text-align: right; display: flex; justify-content: flex-end; gap: 10px;
}
.modal-footer .btn { width: auto; margin-left: 0; }

.close-btn {
    color: #606770; font-size: 24px; font-weight: bold;
    line-height: 1; opacity: 0.7; background: none; border: none; padding: 0;
}
.close-btn:hover, .close-btn:focus { color: #050505; text-decoration: none; cursor: pointer; opacity: 1; }

/* Camera & Image Preview Styles */
#cameraFeed {
    width: 100%; max-height: 60vh; min-height: 200px;
    border: 1px solid #ccd0d5; background-color: #000;
    border-radius: 6px; display: block; object-fit: contain;
}
.image-preview {
    max-width: 100%; max-height: 280px; border: 1px solid #dddfe2;
    border-radius: 6px; margin-bottom: 10px; display: block;
    margin-left: auto; margin-right: auto; background-color: #f0f2f5;
}
#idCardFinalPreviewContainer {
    position: relative; margin-bottom: 20px; max-height: 350px;
    border: 1px solid #dddfe2; background-color: #f0f2f5;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; overflow: hidden;
}
#idCardOverlayCanvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    cursor: crosshair; pointer-events: none; border-radius: 6px;
}
#idCardFinalPreview {
    display: block; width: auto; height: auto; max-width: 100%; max-height: 348px;
    object-fit: contain; border-radius: 6px;
}

/* Supporting Images Preview */
#supportingImagesPreviewContainer {
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px;
    justify-content: flex-start; padding: 10px; background-color: #f0f2f5; border-radius: 6px;
}
.supporting-image-item {
    position: relative; border: 1px solid #ccd0d5; padding: 4px;
    border-radius: 4px; background-color: #fff; width: calc(33.333% - 7px);
    box-sizing: border-box; max-width: 100px; display: flex;
    align-items: center; justify-content: center;
}
.supporting-image-item img {
    display: block; width: 100%; height: 70px;
    object-fit: cover; border-radius: 3px;
}
.supporting-image-item .delete-supporting-img-btn {
    position: absolute; top: -10px; right: -10px; background: #fa383e;
    color: white; border: 2px solid white; border-radius: 50%;
    width: 26px; height: 26px; font-size: 16px; line-height: 22px;
    text-align: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.supporting-image-item .delete-supporting-img-btn:hover { background: #d92020; }

/* Final Review Styles */
#finalPreviewContent .preview-section { margin-bottom: 20px; }
#finalPreviewContent .preview-section h3 {
    font-size: 1.15em; color: #050505; border-bottom: 1px solid #dddfe2;
    padding-bottom: 8px; margin-bottom: 12px; text-align: left;
}
#finalPreviewContent p { margin: 6px 0; color: #1c1e21; }
#finalPreviewContent p strong { color: #606770; margin-right: 5px; }
#finalPreviewContent img {
    max-width: 100%; height: auto; max-height: 200px; object-fit: contain;
    margin-top: 10px; border: 1px solid #ccd0d5; border-radius: 6px;
    display: block; margin-left: auto; margin-right: auto;
}

/* Loading & Status Message Styles */
#loadingIndicator {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(255, 255, 255, 0.9); z-index: 1060;
    display: flex; justify-content: center; align-items: center;
}
#loadingIndicator p {
    background: #4b4f56; color: #fff; padding: 20px 30px;
    border-radius: 8px; display: inline-block; font-size: 1.1em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
#statusMessageContainer { margin: 15px 0; }
.status-message {
    padding: 12px 15px; border-radius: 6px; margin-bottom: 12px;
    font-size: 0.95em; border: 1px solid transparent; line-height: 1.4;
}
.status-success { background-color: #e9f6ec; color: #2b8a3e; border-color: #a3d9b1; }
.status-error { background-color: #fdecea; color: #c92a2a; border-color: #f7b2b2; }
.status-info { background-color: #e7f5ff; color: #1877f2; border-color: #a5d8ff; }
.status-warning { background-color: #fff9db; color: #e67700; border-color: #ffe066;}

/* Report Page Styles */
.report-filters {
    background-color: #f0f2f5; padding: 15px; border-radius: 8px; margin-bottom: 25px;
    display: flex; flex-direction: column; gap: 15px; align-items: stretch;
}
.report-filters .filter-group { display: flex; flex-direction: column; gap: 6px; }
.report-filters label { font-weight: 500; color: #606770; font-size: 0.9em;}
.report-filters select,
.report-filters input[type="date"],
.report-filters input[type="month"] {
    padding: 10px 12px; border: 1px solid #ccd0d5; border-radius: 6px;
    width: 100%; box-sizing: border-box; font-size: 1em;
}
.report-filters .btn { margin-top: 10px; }

#reportCalendarView { /* Renamed from #reportCalendarContainer for clarity */
    background-color: #fff; padding: 15px; border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 25px;
}
.calendar {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
    padding: 10px; border-radius: 6px; background-color: #fff;
}
.calendar-header, .calendar-day {
    text-align: center; padding: 8px 4px; font-size: 0.85em;
    background-color: #f0f2f5; border-radius: 4px;
}
.calendar-header { font-weight: 600; color: #050505; }
.calendar-day.has-data { background-color: #a5d8ff; color: #1877f2; cursor: pointer; font-weight: 600; }
.calendar-day.has-data:hover { background-color: #82c9ff; }
.calendar-day.empty { background-color: #e4e6eb; opacity: 0.7; }
#calendarMonthYear { font-size: 1.2em; font-weight: 600; margin-bottom: 15px; text-align: center; }
.calendar-nav { text-align: center; margin-bottom: 15px; }
.calendar-nav .btn { width: auto; display: inline-block; margin: 0 8px; padding: 6px 10px; font-size: 0.9em; }

#reportSummaryView, #reportDetailView {
    background-color: #fff; padding: 15px; border-radius: 8px;
    margin-bottom: 25px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#reportSummaryView h3, #reportDetailView h3 {
    text-align: left; margin-bottom: 15px; padding-bottom: 10px;
    border-bottom: 1px solid #dddfe2;
}

#reportTable {
    width: 100%; border-collapse: collapse; margin-top: 0; font-size: 0.9em;
    background-color: #fff; border-radius: 6px; overflow: hidden;
}
#reportTable th, #reportTable td { border: 1px solid #dddfe2; padding: 10px 12px; text-align: left; }
#reportTable th { background-color: #f0f2f5; font-weight: 600; color: #050505; }
#reportTable tr:nth-child(even) td { background-color: #f9fafb; }
#reportTable td a { color: #1877f2; text-decoration: none; }
#reportTable td a:hover { text-decoration: underline; }

/* Specific class for OCR select buttons */
.select-from-image-btn {
    padding: 6px 10px !important; font-size: 0.85em !important; width: auto !important;
    flex-shrink: 0; margin-left: 8px !important; vertical-align: middle;
    margin-bottom: 0 !important; background-color: #e4e6eb !important; color: #050505 !important;
}
.select-from-image-btn:hover { background-color: #d8dbdf !important; }

/* Responsive adjustments for larger screens */
@media (min-width: 576px) { /* Small devices (landscape phones) */
    .form-actions { flex-direction: row; justify-content: flex-end; }
    .form-actions .btn { width: auto; margin-right: 10px; }
    .form-actions .btn:last-child { margin-right: 0; }

    .supporting-image-item { width: calc(25% - 8px); max-width: 100px; }
    .report-filters { flex-direction: row; align-items: flex-end; gap: 12px; }
    .report-filters .filter-group { flex-grow: 1; }
    .report-filters .btn { width: auto; margin-top: 0; align-self: flex-end; }
}

@media (min-width: 768px) { /* Medium devices (tablets) */
    body { padding: 20px; }
    .container { padding: 25px 30px; }
    h1 { font-size: 2em; } h2 { font-size: 1.6em; } h3 { font-size: 1.3em; }

    .btn { margin-bottom: 0; }
    .btn + .btn, .btn.btn-inline + .btn.btn-inline { margin-left: 10px; }
    .form-actions .btn + .btn { margin-left: 10px; }

    .form-group input[type="text"].prefix-other-input {
        width: auto; display: inline-block; margin-left: 10px; margin-top: 0;
    }

    #cameraFeed { max-height: 450px; }
    .image-preview { max-height: 320px; }
    #idCardFinalPreviewContainer { max-height: 400px; }
    #idCardFinalPreview { max-height: 398px; }

    .supporting-image-item { width: auto; max-width: 110px; }
    .supporting-image-item img { height: 90px; }

    #reportTable { font-size: 0.95em; }
    #reportTable th, #reportTable td { padding: 12px 15px; }
}

@media (min-width: 992px) { /* Large devices (desktops) */
    .container { max-width: 800px; }
    .supporting-image-item { max-width: 120px; }
}