:root {
    --primary-color: #3498db;
    --primary-color-dark: #2980b9;
    --secondary-color: #95a5a6;
    --secondary-color-dark: #7f8c8d;
    --danger-color: #e74c3c;
    --danger-color-dark: #c0392b;
    --warning-color: #f39c12;
    --warning-color-dark: #e67e22;
    --light-color: #fff;
    --dark-color: #2c3e50;
    --grey-color: #f0f2f5;
    --border-radius: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

h2 {
    margin-bottom: 1.5rem;
    color: #3498db;
}

.upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.image-preview {
    width: 300px;
    height: 300px;
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: var(--grey-color);
    transition: all 0.3s ease;
}

.image-preview:hover {
    border-color: var(--primary-color-dark);
    background-color: #e9ecef;
}

.image-preview.dragover {
    border-style: solid;
    transform: scale(1.02);
}

.image-preview img,
.image-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(52, 152, 219, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    font-weight: bold;
    text-align: center;
    transition: var(--transition);
    opacity: 1;
}

.image-preview:hover .upload-overlay {
    background-color: rgba(52, 152, 219, 0.2);
}

.image-preview.has-image .upload-overlay {
    opacity: 0;
}

.image-dimensions {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
    background-color: #f5f5f5;
    padding: 0.5rem;
    border-radius: 4px;
    width: 100%;
    max-width: 300px;
}

.image-dimensions.with-info {
    background-color: #e8f4f8;
    border-left: 3px solid #3498db;
}

.image-dimensions.with-warning {
    background-color: #fdebd0;
    border-left: 3px solid #e67e22;
}

/* Button base styling */
.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    position: relative;
    min-height: 44px; /* Minimum touch target */
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn:active {
    transform: scale(0.98);
    box-shadow: none;
}

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

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

.btn.secondary {
    background-color: var(--secondary-color);
    color: var(--light-color);
}

.btn.secondary:hover {
    background-color: var(--secondary-color-dark);
}

.btn.retry {
    background-color: var(--warning-color);
    color: var(--light-color);
    margin-left: 0.5rem;
}

.btn.retry:hover {
    background-color: var(--warning-color-dark);
}

.btn.cancel {
    background-color: var(--danger-color);
    color: var(--light-color);
    margin-left: 0.5rem;
}

.btn.cancel:hover {
    background-color: var(--danger-color-dark);
}

/* Button icons and text for desktop */
.btn .btn-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.btn .btn-text {
    display: inline-block;
    font-weight: 500;
}

/* Icons using data URIs */
.palmUploadBtn .btn-icon,
#uploadBtn .btn-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E");
}

.palmCameraBtn .btn-icon,
#cameraBtn .btn-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E");
}

.palmCaptureBtn .btn-icon,
#captureBtn .btn-icon {
     background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff' stroke='%23ffffff' stroke-width='1'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3C/svg%3E");
}

.palmRetryBtn .btn-icon,
#retryBtn .btn-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='23 4 23 10 17 10'/%3E%3Cpolyline points='1 20 1 14 7 14'/%3E%3Cpath d='M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15'/%3E%3C/svg%3E");
}

.palmCancelBtn .btn-icon,
#cancelBtn .btn-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}

#compareBtn .btn-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

/* Tablet responsive - smaller gap */
@media (max-width: 768px) {
    .btn {
        padding: 0.6rem 1.2rem;
        gap: 0.3rem;
        font-size: 0.9rem;
    }
}

/* Mobile responsive - icon only */
@media (max-width: 480px) {
    .btn {
        padding: 0.8rem;
        min-width: 50px;
        min-height: 50px;
        border-radius: 8px;
        gap: 0;
    }
    
    /* Hide text on mobile */
    .btn .btn-text {
        display: none;
    }
    
    /* Make icons larger and more visible on mobile */
    .btn .btn-icon {
        font-size: 1.8em;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
        filter: brightness(1.2) contrast(1.1);
    }
    
    /* Enhanced fallback for mobile without emoji */
    .no-emoji .btn.primary .btn-icon::before {
        content: "FILE";
        font-family: Arial, sans-serif;
        font-size: 0.4em;
        font-weight: bold;
        letter-spacing: 0.1em;
    }
    
    .no-emoji .btn.secondary .btn-icon::before {
        content: "CAM";
        font-family: Arial, sans-serif;
        font-size: 0.4em;
        font-weight: bold;
        letter-spacing: 0.1em;
    }
    
    .no-emoji .btn.retry .btn-icon::before {
        content: "RETRY";
        font-family: Arial, sans-serif;
        font-size: 0.35em;
        font-weight: bold;
        letter-spacing: 0.05em;
    }
    
    /* Mobile fallback for cancel button */
    .no-emoji #cancelBtn .btn-icon::before {
        content: "CANCEL";
        font-family: Arial, sans-serif;
        font-size: 0.3em;
        font-weight: bold;
        letter-spacing: 0.05em;
    }
    
    /* Enhanced mobile touch feedback */
    .btn:active {
        transform: scale(0.95);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    /* Better focus indicators for accessibility */
    .btn:focus {
        outline: 3px solid rgba(52, 152, 219, 0.6);
        outline-offset: 2px;
    }
}

/* Ensure result titles stay on one line */
.results-section h2 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
}

/* Request ID input section */
.request-id-input-section {
    margin: 1rem 0;
    padding: 1rem;
    background-color: var(--grey-color);
    border-radius: var(--border-radius);
    border: 1px solid #e0e0e0;
}

.request-id-input-section label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.request-id-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    background-color: #ffffff;
    transition: border-color 0.2s ease-in-out;
}

.request-id-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.request-id-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

/* Request ID display below titles */
.request-id-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--grey-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    margin: -1rem auto 1.5rem;
    max-width: max-content;
    cursor: pointer;
    transition: var(--transition);
}

.request-id-title:hover {
    background-color: #e0e0e0;
}

.request-id-title .request-id-label {
    font-weight: 600;
    color: #495057;
}

.request-id-title .request-id-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background-color: #ffffff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #212529;
    border: 1px solid #ced4da;
    flex: 1;
    word-break: break-all;
}

.request-id-title .copy-icon {
    font-size: 0.9em;
    opacity: 0.6;
    transition: var(--transition);
}

.request-id-title:hover .copy-icon {
    opacity: 1;
    transform: scale(1.1);
}

.results-section {
    padding: 1.5rem;
    border-top: 1px solid #eee;
}

.quality-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #ecf0f1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
    transition: all 0.5s;
}

.score-circle::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: 50%;
    border: 6px solid #3498db;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    opacity: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading .score-circle::before {
    opacity: 1;
}

#scoreValue {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
}

#qualityVerdict {
    margin-top: 0.5rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.detail-checks {
    margin-top: 1.5rem;
    display: grid;
    gap: 0.75rem;
}

.detail-check {
    background-color: var(--grey-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.detail-check.failed-rule {
    background-color: #ffebee;
    border-left: 4px solid #e74c3c;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.1);
}

.warning-icon {
    font-size: 1.2em;
    grid-column: 1;
}

.detail-check:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.check-name {
    font-weight: 500;
}

.check-bar {
    height: 8px;
    background-color: #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.check-fill {
    height: 100%;
    transition: width 0.5s ease-in-out;
}

.check-fill.pass { background-color: #2ecc71; }
.check-fill.fail { background-color: #e74c3c; }
.check-fill.warn { background-color: #f39c12; }

.check-verdict {
    font-weight: bold;
    font-size: 0.9em;
    text-transform: uppercase;
}
.check-verdict.pass { color: #2ecc71; }
.check-verdict.fail { color: #e74c3c; }
.check-verdict.warn { color: #f39c12; }

.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

#cameraPreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.camera-active #cameraPreview {
    display: block;
}

.camera-active #previewImg {
    display: none;
}

.camera-active .upload-overlay {
    display: none;
}

/* Enhanced camera preview - bigger and centered */
.camera-active .image-preview {
    width: 400px;
    height: 400px;
    border: 3px solid var(--primary-color);
    box-shadow: 0 8px 32px rgba(52, 152, 219, 0.3);
    transform: scale(1.05);
    background-color: #000;
}

.camera-active .image-preview video {
    object-fit: cover;
    border-radius: var(--border-radius);
}

/* Center the camera preview container */
.camera-active .upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Enhanced mobile camera preview */
@media (max-width: 900px) {
    .camera-active .image-preview {
        width: 350px;
        height: 350px;
        transform: scale(1.02);
    }
}

@media (max-width: 600px) {
    .camera-active .image-preview {
        width: 320px;
        height: 320px;
        transform: scale(1.0);
        margin: 0 auto 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 1rem;
        padding: 1rem;
    }
    
    .detail-checks {
        grid-template-columns: 1fr;
    }
}

/* Tab Navigation */
.tabs-container {
    margin: 20px 0;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 12px 20px;
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    font-weight: 500;
    font-size: 14px;
    max-width: 90vw;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

.notification.active {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Add specialized notification styles */
.notification.warning {
    background-color: #e74c3c;
    color: white;
    border: 1px solid #c0392b;
}

.notification.info {
    background-color: #3498db;
    color: white;
    border: 1px solid #2980b9;
}

.notification.success {
    background-color: #2ecc71;
    color: white;
    border: 1px solid #27ae60;
}

.notification.loading {
    background-color: #34495e;
    color: white;
    border: 1px solid #2c3e50;
}

.notification-text {
    font-weight: 500;
    font-size: 14px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

/* Hide spinner by default */
.notification:not(.loading) .loading-spinner {
    display: none;
}

/* Show spinner only when loading */
.notification.loading .loading-spinner {
    display: block;
}

.notification.loading .notification-text {
    display: block;
}

/* Mobile responsiveness for notifications */
@media (max-width: 768px) {
    .notification {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
    }
    
    .notification.active {
        transform: none;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    color: var(--secondary-color-dark);
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 2rem 0;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Palm Detection Styles */
.detection-canvas-container {
    width: 100%;
    max-width: 500px;
    margin: 1.5rem auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

#detectionCanvas {
    width: 100%;
    height: auto;
    display: block;
}

.detection-stats {
    background-color: var(--grey-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-item {
    flex: 1;
}

.detection-details {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.palm-detection-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

.palm-detection-item h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.palm-detection-item .detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 8px;
}

.palm-detection-item .detail-label {
    font-weight: 500;
    color: #555;
}

.palm-detection-item .detail-value {
    color: #333;
    font-family: monospace;
}

/* Loading animation for detection results */
#detectionResultsSection.loading .detection-canvas-container::after {
    content: "Processing...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #666;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 4px;
}

.request-id-display {
    grid-column: 1 / -1;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.request-id-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.request-id-label {
    font-weight: bold;
    color: #495057;
    font-size: 0.9rem;
}

.request-id-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background-color: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #212529;
    word-break: break-all;
}

/* Palm Verification Styles */
.verification-upload-section {
    margin-bottom: 2rem;
}

.dual-image-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.image-upload-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-upload-item h3 {
    margin-bottom: 0.75rem;
    text-align: center;
    color: var(--dark-color);
    font-weight: 500;
}

.image-upload-item .image-preview {
    width: 100%;
    max-width: 250px;
    height: 250px;
    margin: 0 auto 1rem;
}

/* Remove image-actions as it's replaced by button-group */
.image-actions {
   display: none;
}

.compare-section {
    text-align: center;
    margin-top: 1.5rem;
}

.btn.large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    min-height: 50px;
}

.btn:disabled {
    background-color: #6c757d;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.6;
    border-color: #5a6268;
}

.btn:disabled:hover {
    background-color: #6c757d;
    border-color: #5a6268;
    box-shadow: none;
}

/* Similarity Display */
.similarity-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.similarity-circle {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #e9ecef, #e9ecef);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.similarity-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #3498db 0%, #2ecc71 0%, #e9ecef 0%);
    transition: all 0.8s ease-in-out;
    transform: rotate(-90deg);
}

.similarity-content {
    position: relative;
    z-index: 2;
    background: white;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.similarity-score {
    font-size: 2.2rem;
    font-weight: bold;
    color: #2c3e50;
}

.similarity-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 0.2rem;
}

.match-verdict {
    text-align: center;
    margin-bottom: 1rem;
}

.verdict-text {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.match-indicator {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.match-indicator.match {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.match-indicator.no-match {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.comparison-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

.detail-label {
    font-weight: 500;
    color: #495057;
}

.detail-value {
    font-weight: bold;
    color: #2c3e50;
}

/* Loading animation for similarity circle */
.similarity-circle.loading .similarity-progress {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Camera functionality for palm verification */
.image-upload-item .image-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-item .camera-active video {
    display: block;
}

.image-upload-item .camera-active img {
    display: none;
}

.image-upload-item .camera-active .upload-overlay {
    display: none;
}

/* Enhanced palm verification camera preview */
.image-upload-item .camera-active .image-preview {
    width: 350px;
    height: 350px;
    border: 3px solid var(--primary-color);
    box-shadow: 0 8px 32px rgba(52, 152, 219, 0.3);
    transform: scale(1.05);
    background-color: #000;
    margin: 0 auto; /* Center the camera preview */
}

.image-upload-item .camera-active .image-preview video {
    object-fit: cover;
    border-radius: var(--border-radius);
}

/* Center align camera container when active */
.image-upload-item .camera-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Next camera highlight animation */
.next-camera-highlight {
    animation: nextCameraGlow 2s ease-in-out;
    border: 3px solid #f39c12 !important;
}

@keyframes nextCameraGlow {
    0%, 100% { 
        border-color: #f39c12;
        box-shadow: 0 0 0 rgba(243, 156, 18, 0.5);
    }
    50% { 
        border-color: #e67e22;
        box-shadow: 0 0 20px rgba(243, 156, 18, 0.8);
    }
}

/* Hide main upload section when on palm verification tab */
.palm-verification-active #mainUploadSection {
    display: none;
}

/* Responsive design for palm verification */
@media (max-width: 768px) {
    .dual-image-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .image-upload-item .image-preview {
        width: 200px;
        height: 200px;
    }
    
    .similarity-circle {
        width: 150px;
        height: 150px;
    }
    
    .similarity-content {
        width: 110px;
        height: 110px;
    }
    
    .similarity-score {
        font-size: 1.8rem;
    }
    
    .image-actions {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .image-actions {
        flex-direction: column;
        width: 100%;
        max-width: none;
    }
    
    .image-actions .btn {
        width: 100%;
        margin-bottom: 0.3rem;
    }
    
    .btn.large {
        width: 100%;
        padding: 0.8rem 1.5rem;
    }
}

.score-circle.good {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}
.score-circle.medium {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}
.score-circle.poor {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* === PALM POSITIONING GUIDE === */
#palmOverlayCanvas,
#palmOverlayCanvas1,
#palmOverlayCanvas2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.palm-positioning-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    border: 3px solid #ff4757;
    border-radius: 15px;
    background: rgba(255, 71, 87, 0.1);
    transition: all 0.3s ease;
    z-index: 20;
    pointer-events: none;
    display: none !important; /* Hide CSS guide completely, using canvas instead */
}

/* Hide guide in all states - using canvas guide instead */
.camera-active .palm-positioning-guide,
.palm-positioning-guide.palm-detected,
.palm-positioning-guide.palm-centered,
.palm-positioning-guide.auto-capture-ready {
    display: none !important;
}

.palm-positioning-guide.palm-detected {
    border-color: #ff9500;
    background: rgba(255, 149, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 149, 0, 0.5);
}

.palm-positioning-guide.palm-centered {
    border-color: #00d2ff;
    background: rgba(0, 210, 255, 0.15);
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.7);
    animation: palmPulse 2s infinite;
}

.palm-positioning-guide.auto-capture-ready {
    border-color: #00d2ff;
    background: rgba(0, 210, 255, 0.2);
    box-shadow: 0 0 40px rgba(0, 210, 255, 0.8);
    animation: autoCaptureReady 1s infinite;
}

@keyframes palmPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

@keyframes autoCaptureReady {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        border-color: #00d2ff;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.08);
        border-color: #0099cc;
    }
}

.palm-feedback-overlay {
    position: relative;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    pointer-events: none;
    backdrop-filter: blur(5px);
}

.feedback-content {
    text-align: center;
}

.positioning-status {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.confidence-indicator {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.auto-capture-countdown {
    font-size: 16px;
    font-weight: bold;
    color: #00d2ff;
    animation: countdownPulse 1s infinite;
}

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

/* Enhanced camera active states */
.camera-active #palmOverlayCanvas,
.camera-active #palmOverlayCanvas1,
.camera-active #palmOverlayCanvas2 {
    display: block !important;
}

/* Hide CSS guide completely - using canvas guide instead */
.camera-active .palm-positioning-guide {
    display: none !important;
}

.camera-active .palm-feedback-overlay {
    display: block !important;
}

/* Auto-capture settings panel */
.auto-capture-settings {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
    padding: 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.auto-capture-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-capture-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.auto-capture-toggle label {
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    color: #2c3e50;
}

.countdown-setting {
    display: flex;
    align-items: center;
    gap: 8px;
}

.countdown-setting select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

/* Status indicators */
.confidence-indicator.good { color: #2ed573; }
.confidence-indicator.warning { color: #ffa726; }
.confidence-indicator.error { color: #ff4757; }

.positioning-status.good { color: #2ed573; }
.positioning-status.warning { color: #ffa726; }
.positioning-status.error { color: #ff4757; }

/* Button progress bars */
.btn {
    position: relative;
    overflow: hidden;
}

.btn-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 255, 255, 1) 50%, 
        rgba(255, 255, 255, 0.8) 100%);
    transition: width 0.3s ease;
    z-index: 1;
}

.btn.loading .btn-progress-bar {
    width: 100%;
    animation: progressBarMove 2s ease-in-out infinite;
}

@keyframes progressBarMove {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading .btn-text {
    opacity: 0.7;
}

.btn.loading .btn-icon {
    opacity: 0.7;
}

/* Mobile responsiveness for positioning guide */
@media (max-width: 768px) {
    .palm-positioning-guide {
        width: 120px;
        height: 120px;
        border-width: 2px;
    }
    
    .camera-active .palm-positioning-guide {
        width: 180px;
        height: 180px;
        border-width: 3px;
    }
    
    .palm-feedback-overlay {
        margin: 8px 0;
        padding: 10px;
    }
    
    .positioning-status {
        font-size: 13px;
    }
    
    .confidence-indicator {
        font-size: 11px;
    }
    
    .auto-capture-countdown {
        font-size: 15px;
    }
    
    .auto-capture-settings {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .palm-positioning-guide {
        width: 100px;
        height: 100px;
    }
    
    .camera-active .palm-positioning-guide {
        width: 160px;
        height: 160px;
    }
    
    .auto-capture-settings {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px;
    }
    
    .countdown-setting {
        width: 100%;
        justify-content: space-between;
    }
} 