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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f0f2f5;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.stat-item i {
    font-size: 1.5em;
    color: #1976d2;
}

.stat-value {
    font-size: 1.2em;
    font-weight: 600;
    color: #1976d2;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px;
}

.event-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.face-image-container {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #f8f9fa;
    overflow: hidden;
}

.face-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.card-content {
    padding: 15px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.event-type {
    font-size: 0.85em;
    font-weight: 500;
    color: #1976d2;
    background: #e3f2fd;
    padding: 4px 12px;
    border-radius: 20px;
}

.event-timestamp {
    font-size: 0.8em;
    color: #666;
}

.quick-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-icon {
    color: #1976d2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-text {
    flex: 1;
    min-width: 0;
}

.event-timestamp {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.timestamp-relative {
    font-weight: 500;
    color: #333;
}

.timestamp-absolute {
    font-size: 0.75em;
    color: #666;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.action-button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.view-details {
    background: #e3f2fd;
    color: #1976d2;
}

.view-details:hover {
    background: #bbdefb;
}

.copy-json {
    background: #f5f5f5;
    color: #333;
}

.copy-json:hover {
    background: #eeeeee;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

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

.modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2em;
    color: #1976D2;
}

.detection-time {
    font-size: 0.85em;
    color: #666;
    margin-left: 12px;
}

.detection-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.image-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1976D2;
    margin: 0;
}

.image-container {
    position: relative;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-container.image-error::after {
    content: attr(data-error);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #d32f2f;
    font-size: 14px;
    text-align: center;
}

.detail-group {
    display: grid;
    gap: 12px;
    background: #f5f5f5;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.xml-section {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.xml-section h5 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    color: #1976D2;
}

.xml-content {
    background: #fff;
    padding: 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    overflow-x: auto;
    margin: 0;
}

/* Plate analysis improvements */
.plate-section {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 8px;
}

.plate-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1976D2;
    margin: 0 0 16px 0;
}

.analyze-btn {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: #1976D2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.analyze-btn:hover {
    background: #1565C0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: #eee;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    gap: 20px;
}

.image-section {
    flex: 1;
    min-width: 0;
}

.details-section {
    width: 300px;
    flex-shrink: 0;
}

.background-image-container {
    width: 100%;
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.background-image-container canvas {
    width: 100%;
    height: auto;
    display: block;
}

.json-view {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

.copy-success {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    animation: fadeOut 2s forwards;
    display: none;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

/* Icons */
.icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.view-switcher {
    display: flex;
    gap: 10px;
}

.view-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #f8f9fa;
    color: #666;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
}

.view-button.active {
    background: #e3f2fd;
    color: #1976d2;
}

.view-button:hover:not(.active) {
    background: #eee;
}

.views-container {
    position: relative;
    min-height: 500px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.split-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: calc(100vh - 150px);
}

.split-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.split-section h2 {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #333;
}

.events-list {
    overflow-y: auto;
    flex-grow: 1;
}

.captures-list {
    overflow-y: auto;
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    padding: 5px;
}

.capture-item {
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.capture-item:hover {
    transform: scale(1.02);
}

.capture-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.capture-item .capture-time {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.8em;
    text-align: center;
}

.list-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.list-card:hover {
    background: #f8f9fa;
}

.list-card .face-preview {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
}

.list-card .face-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-card .list-content {
    flex: 1;
    min-width: 0;
}

.list-card .list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.list-card .list-title {
    font-weight: 500;
    color: #333;
}

.list-card .list-time {
    font-size: 0.85em;
    color: #666;
}

.list-card .list-details {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #666;
}

.list-card .detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

.section-stats {
    font-size: 0.9em;
    color: #666;
    background: #f8f9fa;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Live View Styles */
.live-container {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    position: relative;
}

.live-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
}

.live-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.live-info h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.2em;
    color: white;
}

.live-stats {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

.live-controls {
    display: flex;
    gap: 10px;
}

.control-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: rgba(25, 118, 210, 0.2);
    color: white;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.control-button:hover {
    background: rgba(25, 118, 210, 0.4);
}

.live-content {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.live-feed {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-feed img,
.live-feed canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.background-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.recent-face-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 120px;
    height: 120px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s;
    z-index: 10;
}

.recent-face-overlay:hover {
    transform: scale(1.1);
}

.recent-face-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-face-time {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.7em;
    text-align: center;
}

/* Enhanced highlight effects */
.capture-item.highlight {
    box-shadow: 0 0 0 3px #1976d2, 0 4px 20px rgba(25, 118, 210, 0.3);
    transform: scale(1.15);
    z-index: 1;
}

.list-card.highlight {
    background: #e3f2fd;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}

/* Analytics Dashboard */
.analytics-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.analytics-chart {
    flex: 1;
    min-height: 100px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-title {
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-content {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.bar {
    flex: 1;
    background: #bbdefb;
    border-radius: 4px 4px 0 0;
    transition: height 0.3s;
    position: relative;
    min-width: 20px;
}

.bar:hover::after {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

/* Dark Mode Styles */
.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode .dashboard-header,
.dark-mode .event-card,
.dark-mode .split-section,
.dark-mode .analytics-bar,
.dark-mode .modal-content {
    background: #1e1e1e;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dark-mode .stat-item {
    background: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .stat-value {
    color: #64b5f6;
}

.dark-mode .stat-label {
    color: #b0b0b0;
}

.dark-mode .view-button {
    background: #2d2d2d;
    color: #b0b0b0;
}

.dark-mode .view-button.active {
    background: #1565c0;
    color: white;
}

.dark-mode .view-button:hover:not(.active) {
    background: #3d3d3d;
}

.dark-mode .list-card {
    border-color: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .list-card:hover {
    background: #2d2d2d;
}

.dark-mode .list-card.highlight {
    background: #1565c0;
    color: white;
}

.dark-mode .list-title {
    color: #e0e0e0;
}

.dark-mode .list-time,
.dark-mode .list-details {
    color: #b0b0b0;
}

.dark-mode .modal-header {
    background: #2d2d2d;
    border-color: #3d3d3d;
}

.dark-mode .modal-close {
    color: #b0b0b0;
}

.dark-mode .json-view {
    background: #2d2d2d;
    color: #e0e0e0;
}

/* Recent Faces Panel */
.recent-faces-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 300px;
    height: 200px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px 0 0 0;
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.recent-faces-header {
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.recent-faces-title {
    font-size: 0.9em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-faces-content {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    gap: 10px;
    padding: 10px;
}

.recent-face-item {
    flex: 0 0 120px;
    height: 140px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.recent-face-item:hover {
    transform: translateY(-2px);
    border-color: #1976d2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.recent-face-item.active {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px #1976d2;
}

.recent-face-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.recent-face-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: white;
    font-size: 0.75em;
}

.recent-face-time {
    opacity: 0.8;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-face-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

.face-detail {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.9em;
}

.new-detection-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #1976d2;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.recent-face-item.new-detection .new-detection-badge {
    opacity: 1;
    transform: translateY(0);
}

/* Dark mode modal */
.dark-mode .modal-content {
    background: #1e1e1e;
    color: #e0e0e0;
}

.dark-mode .modal-header {
    background: #2d2d2d;
    border-bottom-color: #3d3d3d;
}

.dark-mode .modal-title {
    color: #e0e0e0;
}

.dark-mode .modal-close {
    color: #b0b0b0;
}

.dark-mode .modal-close:hover {
    background: #3d3d3d;
}

/* Keyboard Shortcuts Tooltip */
.shortcut-tooltip {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    display: none;
}

.shortcut-tooltip.show {
    display: block;
}

.shortcut-key {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
}

/* Quick Actions Menu */
.quick-actions {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    gap: 10px;
}

.action-fab {
    width: 50px;
    height: 50px;
    border-radius: 25px;
    background: #1976d2;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.action-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Bookmarks */
.bookmark-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffc107;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 1;
}

/* Add animation for live updates */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.update-pulse {
    animation: pulse 0.3s ease-in-out;
}

/* Recent Faces Container */
.recent-faces-container {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 200px;
    max-height: calc(100vh - 250px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    overflow-y: auto;
    z-index: 10;
    transition: all 0.3s ease;
}

.recent-faces-container.multi-column {
    width: 420px;
    grid-template-columns: repeat(2, 1fr);
}

.recent-faces-container.three-columns {
    width: 630px;
    grid-template-columns: repeat(3, 1fr);
}

.recent-face-item {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    aspect-ratio: 1;
}

.recent-face-item:hover {
    transform: scale(1.05);
    border-color: rgba(25, 118, 210, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.recent-face-item.active {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px #1976d2;
}

.recent-face-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.recent-face-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: white;
    font-size: 0.75em;
}

.recent-face-time {
    opacity: 0.8;
    margin-bottom: 4px;
}

.recent-face-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.face-detail {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.face-detail i {
    font-size: 1.1em;
}

.new-detection-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #1976d2;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.recent-face-item.new-detection .new-detection-badge {
    opacity: 1;
    transform: translateY(0);
}

/* Vehicle Detection Styles */
.vehicle-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 16px;
    transition: transform 0.2s;
}

.vehicle-card:hover {
    transform: translateY(-2px);
}

.vehicle-preview {
    position: relative;
    width: 100%;
    height: 200px;
}

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

.vehicle-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    justify-content: flex-end;
}

.analyze-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

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

.vehicle-content {
    padding: 16px;
}

.vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.vehicle-title {
    display: flex;
    flex-direction: column;
}

.vehicle-id {
    font-size: 18px;
    font-weight: 600;
    color: #1976D2;
}

.vehicle-time {
    font-size: 14px;
    color: #666;
}

.vehicle-camera {
    background: #E3F2FD;
    color: #1976D2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.vehicle-details {
    display: grid;
    gap: 12px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.plate-info {
    background: #F5F5F5;
    padding: 12px;
    border-radius: 8px;
    margin-top: 8px;
}

.plate-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.plate-loading.hidden {
    display: none;
}

.plate-details {
    display: grid;
    gap: 8px;
}

.plate-number {
    font-size: 24px;
    font-weight: 600;
    color: #1976D2;
}

.plate-meta {
    display: flex;
    gap: 12px;
    color: #666;
    font-size: 14px;
}

.vehicle-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1976D2;
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-top: 4px;
}

/* Vehicle Dashboard Layout */
.vehicle-dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 20px;
    height: calc(100vh - 100px);
}

.vehicle-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-card i {
    font-size: 24px;
    color: #1976D2;
    margin-bottom: 8px;
}

.vehicle-grid-container {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    overflow-y: auto;
    padding: 4px;
    height: 100%;
}

.vehicle-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    height: 200px;
}

.vehicle-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #f0f0f0; /* Placeholder background */
}

.vehicle-card img[src=""], 
.vehicle-card img:not([src]) {
    visibility: hidden;
}

.vehicle-card::after {
    content: 'Image not available';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 14px;
    display: none;
}

.vehicle-card img[src=""] + .vehicle-card::after,
.vehicle-card img:not([src]) + .vehicle-card::after {
    display: block;
}

.vehicle-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.vehicle-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Update plate info styles */
.plate-result {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
}

.plate-number {
    font-size: 28px;
    font-weight: 600;
    color: #1976D2;
    margin-bottom: 12px;
    text-align: center;
}

.plate-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 6px;
}

.plate-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: #666;
}

.plate-info-placeholder {
    text-align: center;
    color: #666;
    padding: 20px;
}

.error {
    color: #d32f2f;
    padding: 16px;
    background: #ffebee;
    border-radius: 8px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.error i {
    font-size: 24px;
}

.retry-btn {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 14px;
}

.retry-btn:hover {
    background: #b71c1c;
}

.no-plate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #666;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.no-plate i {
    color: #ffa000;
}

.plate-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: #1976D2;
    background: #e3f2fd;
    border-radius: 8px;
}

.plate-loading i {
    animation: spin 1s linear infinite;
}

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