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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

.camera-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 20px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

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

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.status {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.detection-box {
    position: absolute;
    border: 3px solid #ff4757;
    background: rgba(255, 71, 87, 0.1);
    border-radius: 5px;
    display: none;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detection-log, .settings {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.detection-log h3, .settings h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.log-content {
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.detected {
    color: #dc3545;
    font-weight: bold;
}

.log-entry.info {
    color: #007bff;
}

.log-entry.success {
    color: #28a745;
}

.setting-item {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item label {
    min-width: 150px;
    font-weight: 500;
}

.setting-item input[type="range"] {
    flex: 1;
}

.setting-item input[type="number"] {
    width: 100px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.setting-item input[type="text"] {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
}

.whitelist-presets {
    margin-top: 10px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.whitelist-presets .btn {
    font-size: 0.8rem;
    padding: 4px 8px;
    min-width: auto;
}

.zone-controls {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.zone-controls input {
    text-align: center;
    font-family: monospace;
}

.alarm {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: pulse 0.5s ease-in-out;
}

.alarm.hidden {
    display: none;
}

.alarm-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: shake 0.5s ease-in-out;
}

.alarm-content h2 {
    color: #dc3545;
    font-size: 2rem;
    margin-bottom: 20px;
}

.alarm-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #333;
}

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

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

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .setting-item label {
    min-width: auto;
}

.snapshots-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.snapshots-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.snapshots-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.snapshots-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.snapshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.snapshot-item {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #f8f9fa;
    text-align: center;
}

.snapshot-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 8px;
}

.snapshot-info {
    font-size: 0.8rem;
    color: #666;
    font-family: monospace;
}

.snapshot-text {
    font-size: 0.7rem;
    color: #333;
    background: #e9ecef;
    padding: 4px;
    border-radius: 3px;
    margin-top: 5px;
    word-break: break-all;
    max-height: 60px;
    overflow-y: auto;
}
} 