:root {
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --success-color: #4CAF50;
    --error-color: #f44336;
    --text-primary: #333;
    --text-secondary: #666;
    --background: #f9f9f9;
}

body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--background);
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
}

.cta-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.cta-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
@media (max-width: 768px) {

    .cta-button {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

#canvas {
    display: none;
}

#loginOverlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
}
#loginOverlay .login-box {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 400px;
}
.login-input {
    width: 100%;
    padding: 12px;
    margin: 1rem 0;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}
.login-input:focus {
    border-color: var(--primary-color);
    outline: none;
}
.login-button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f5f7fa;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-weight: bold;
    color: #666;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 0.9em;
    line-height: 1.5;
}

.features {
    margin: 30px 0;
}

.feature-item {
    display: flex;
    align-items: center;
    margin: 15px 0;
    font-size: 0.9em;
    color: #444;
}

.feature-item .icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.terms {
    font-size: 0.8em;
    color: #666;
    margin-top: 20px;
}

.terms a {
    color: #2196F3;
    text-decoration: none;
}

/* Main content styles after login */
#mainContent {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f7fa;
    z-index: 900;
    padding: 20px;
    box-sizing: border-box;
}

.action-buttons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 360px;
    padding: 16px;
}

.action-button {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: none;
}

.photo-button {
    background: #000000;
    color: white;
}

.cash-button {
    background: white;
    color: #000000;
    border: 1px solid #E5E5E5;
}

.manual-button {
    background: #F5F5F5;
    color: #000000;
    border: none;
}

.action-button:active {
    transform: scale(0.98);
}

.action-button .icon {
    font-size: 18px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .action-buttons {
        width: 85%;
    }
    
    .action-button {
        padding: 14px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .action-buttons {
        width: 80%;
    }
}

.photo-options-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-content button {
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.modal-content button:first-child {
    background: #000;
    color: white;
}

.modal-content button:nth-child(2) {
    background: #f5f5f5;
    color: #000;
}

.modal-content button:last-child {
    background: white;
    color: #666;
    border: 1px solid #ddd;
}

.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 16px 32px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    font-size: 1.2em;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-info {
    background: #2196F3;
}

.toast-success {
    background: #4CAF50;
}

.toast-error {
    background: #f44336;
}

.modal-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    text-align: center;
}

.photo-option-btn {
    width: 100%;
    padding: 12px;
    margin: 5px 0;
    border: none;
    border-radius: 8px;
    background: #2196F3;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.photo-option-btn:hover {
    background: #1976D2;
}

/* Success Modal Styles */
.success-modal {
    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;
}

.success-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}


@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #4CAF50;
    }
}

.receipt-text {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    text-align: left;
    margin: 20px 0;
}

.receipt-text pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: monospace;
}

.checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #4CAF50;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #4CAF50;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #4CAF50;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

.close-button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

#camera-preview {
    flex: 1;
    object-fit: cover;
}

.failure-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.failure-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.error-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 20px;
    border-radius: 50%;
    stroke: #ff4444;
    stroke-width: 2;
    stroke-miterlimit: 10;
    animation: errorAnimation 0.5s ease-in-out;
}

@keyframes errorAnimation {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.error-message {
    color: #ff4444;
    margin: 15px 0;
    font-size: 1.1em;
}

.error-details {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    text-align: left;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.try-again-button {
    background: #ff4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s ease;
}

.try-again-button:hover {
    background: #ff6666;
}

.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.camera-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 300px;
    gap: 10px;
}

#camera-preview {
    flex: 1;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.camera-controls {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    bottom: 20px;
    left: 16px;
    right: 16px;
}

.camera-button {
    flex: 1;
    padding: 16px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.camera-button.retry {
    background-color: #f44336;
    color: white;
}

.camera-button:active {
    transform: scale(0.98);
}

/* Make buttons more pill-shaped */
.camera-button {
    border-radius: 100px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px;
    margin: 1rem 0;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.button-group button {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button-group .camera-button {
    background: var(--primary-color);
    color: white;
    border: none;
}

.button-group .camera-button:hover {
    background: var(--primary-dark);
}

.videoView {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.highlighter {
    position: absolute;
    border: 3px solid #ff0000;
    z-index: 1;
    pointer-events: none;
    transition: all 0.2s ease-out;
}

#liveView p {
    border-radius: 4px;
    pointer-events: none;
}

#camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Add this new style for cancel button */
.cancel-btn {
    width: 100%;
    padding: 12px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #f5f5f5;
}

.camera-text {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    text-align: center;
}

.camera-text p {
    color: white;
    margin: 0;
    font-size: 14px;
}

.camera-guidance {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.detection-stats {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px 40px;
    border-radius: 100px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease-out;
}

.detection-stats p {
    margin: 0;
    color: white;
    font-size: 32px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

/* Color-specific styles */
.detection-stats p[style*="color: #FFA500"] {
    color: #FFB74D !important; /* Warmer orange */
    display: flex;
    align-items: center;
    gap: 10px;
}

.detection-stats p[style*="color: #FFA500"]::before {
    content: "⚠️";
    font-size: 24px;
}

.detection-stats p[style*="color: #4CAF50"] {
    color: #81C784 !important; /* Softer green */
    display: flex;
    align-items: center;
    gap: 10px;
}

.detection-stats p[style*="color: #4CAF50"]::before {
    content: "👍";
    font-size: 24px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .detection-stats {
        padding: 15px 30px;
    }

    .detection-stats p {
        font-size: 24px;
    }

    .detection-stats p[style*="color: #FFA500"]::before,
    .detection-stats p[style*="color: #4CAF50"]::before {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .detection-stats {
        padding: 12px 24px;
    }

    .detection-stats p {
        font-size: 20px;
    }

    .detection-stats p[style*="color: #FFA500"]::before,
    .detection-stats p[style*="color: #4CAF50"]::before {
        font-size: 18px;
    }
}

#areaRatioDisplay {
    font-family: monospace;
    font-weight: bold;
}

.ratio-value {
    color: #4CAF50;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}

/* Add these new styles for the countdown timer */

.countdown-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 120px;
    color: white;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    opacity: 0;
    z-index: 10;
}


.countdown-animation {
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {

    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
}

#confirmationModal {
    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;
}

#confirmationModal .modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#confirmationModal h2 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 20px;
}

#confirmationModal .question-icon {
    font-size: 40px;
    text-align: center;
    margin-bottom: 20px;
}

#confirmationModal .form-group {
    margin-bottom: 20px;
    text-align: left;
}

#confirmationModal .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 600;
}

#confirmationModal .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: #f8f8f8;
    box-sizing: border-box;
}

#confirmationModal .form-group input:not([readonly]) {
    background: white;
    border-color: var(--primary-color);
}

#confirmationModal .button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#confirmationModal .button-group button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#confirmationModal .primary-button {
    background: #000;
    color: white;
    border: none;
}

#confirmationModal .secondary-button {
    background: white;
    color: #000;
    border: 1px solid #000;
}

/* Add these new styles */
.date-validation-message {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    font-size: 0.9em;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.date-validation-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Add animation keyframes */
@keyframes validationPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.date-validation-message.show {
    opacity: 1;
    transform: translateY(0);
    animation: validationPulse 2s infinite;
}

/* Image Preview Modal Styles */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview-modal.show {
    opacity: 1;
}

.preview-content {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.preview-header {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.preview-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.image-container {
    position: relative;
    flex: 1;
    min-height: 200px;
    max-height: 70vh;
    overflow: hidden;
    background: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.zoom-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.zoom-hint .icon {
    font-size: 1.1em;
}

.preview-controls {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-button.proceed-btn {
    background: #000;
    color: white;
}

.preview-button.retake-btn {
    background: #dc3545;
    color: white;
}

.preview-button.retake-btn:hover {
    background-color: #c82333;  /* Darker red on hover */
}

.preview-button .icon {
    font-size: 1.2em;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .preview-content {
        width: 95%;
        max-height: 95vh;
    }

    .preview-header h3 {
        font-size: 1.1rem;
    }

    .preview-controls {
        padding: 12px;
    }

    .preview-button {
        padding: 10px;
        font-size: 0.95rem;
    }

    .zoom-hint {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .preview-content {
        background: #1a1a1a;
    }

    .preview-header {
        background: #2d2d2d;
        border-bottom-color: #333;
    }

    .preview-header h3 {
        color: #fff;
    }

    .image-container {
        background: #2d2d2d;
    }

    .preview-controls {
        background: #1a1a1a;
        border-top-color: #333;
    }
}

.share-btn {
    background: var(--primary-color);
}

.close-btn {
    background: #28a745;
}

close-btn:hover {
    background-color: #218838;  /* Darker green on hover */
}

.recent-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.recent-file-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 3/4;
    background: #f0f0f0;
    transition: transform 0.2s ease;
}

.recent-file-item:hover {
    transform: scale(1.05);
}

.recent-file-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-file-timestamp {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 12px;
    text-align: center;
}

.view-image-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-image-btn:hover {
    background: #ebebeb;
    transform: translateY(-1px);
}

.view-image-btn .icon {
    font-size: 1.2em;
}

.image-preview-modal .image-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.image-preview-modal .preview-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast; /* Improves sharpness on webkit browsers */
    image-rendering: crisp-edges;
    transform: translateZ(0); /* Forces GPU acceleration */
    backface-visibility: hidden; /* Reduces blurriness during transforms */
    will-change: transform; /* Optimizes performance */
}

/* Remove any existing blur filters or transformations */
.image-preview-modal.show .preview-content {
    transform: none;
}

.loading-indicator {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Add these styles */
.date-warning {
    border-color: #ff6b6b !important;
    animation: gentleShake 0.5s ease-in-out;
    background-color: rgba(255, 107, 107, 0.05) !important;
}

@keyframes gentleShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.date-validation-message {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    font-size: 0.9em;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.date-validation-message.show {
    opacity: 1;
    transform: translateY(0);
}

.warning-icon {
    color: #ff9800;
    display: inline-flex;
    align-items: center;
}

.warning-icon svg {
    width: 16px;
    height: 16px;
}

#userNav {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    width: calc(100% - 40px);
}

.nav-left, .nav-right {
    display: flex;
    gap: 12px;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-button.primary {
    background: #2196F3;
    color: white;
}

.nav-button.primary:hover {
    background: #1976D2;
}

.nav-button.secondary {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.nav-button.secondary:hover {
    background: #f8f9fa;
}

.nav-button .icon {
    font-size: 16px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #userNav {
        top: 12px;
        left: 12px;
        right: 12px;
        width: calc(100% - 24px);
    }

    .nav-button {
        padding: 8px 16px;
        font-size: 13px;
    }

    .nav-button .icon {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .nav-button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

.form-group input {
    width: 100%;
    padding: 12px;
    margin: 1rem 0;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

#manualReceiptForm {
    width: 100%;
    box-sizing: border-box;
}

#confirmAmount {
    font-weight: 600;  /* Makes text bold (600 is semi-bold) */
    /* or use font-weight: bold; for even bolder text */
}

/* Multiple Uploads Modal Styles */
.multiple-uploads-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.multiple-uploads-modal.show {
    opacity: 1;
}

.multiple-uploads-modal .modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease forwards;
}

.multiple-uploads-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.multiple-uploads-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.multiple-uploads-modal .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.multiple-uploads-modal .uploads-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: 60vh;
}

.multiple-uploads-modal .modal-footer {
    padding: 16px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.multiple-uploads-modal .add-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.multiple-uploads-modal .add-more-btn:hover {
    background-color: #eee;
}

.multiple-uploads-modal .plus-icon {
    font-size: 18px;
    font-weight: bold;
}

.multiple-uploads-modal .submit-all-btn {
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.multiple-uploads-modal .submit-all-btn:hover {
    background-color: #333;
}

.validation-error {
    color: red;
    font-size: 12px;
    margin-top: 4px;
}

/* Image Entry Styles */
.image-entry {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    overflow: hidden;
}

.image-entry .image-preview {
    position: relative;
    height: 180px;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.image-entry .image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-entry .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.image-entry .delete-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.image-entry .delete-btn svg {
    width: 18px;
    height: 18px;
}

.image-entry .entry-details {
    padding: 16px;
}

.image-entry .form-group {
    margin-bottom: 12px;
}

.image-entry .form-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.image-entry .input-with-icon {
    position: relative;
}

.image-entry .currency-symbol {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.image-entry .amount-input {
    padding-left: 24px;
}

.image-entry input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.image-entry input:focus {
    border-color: #000;
    outline: none;
}

.image-entry .date-input-container {
    position: relative;
    display: flex;
}

.image-entry .date-input {
    flex: 1;
    padding-right: 40px;
}

.image-entry .calendar-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    background: none;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.image-entry .calendar-btn svg {
    width: 20px;
    height: 20px;
    color: #666;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .multiple-uploads-modal .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .image-entry .image-preview {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .multiple-uploads-modal .modal-header h3 {
        font-size: 16px;
    }

    .image-entry .form-group label {
        font-size: 13px;
    }

    .image-entry input {
        padding: 8px 10px;
        font-size: 13px;
    }
}
