* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f5f7fa;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 20px;
    background: #111184; /* Green header */
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 500px;
}

.mode-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: #fff;
    color: #111184; /* Green text */
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mode-btn i {
    font-size: 1.5rem;
}

.mode-btn.active {
    background: #111184; /* Green background */
    color: white;
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.detection-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.media-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 4/3;
    background: #e9ecef;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

#placeholder {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

#placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.7;
}

video, canvas, #uploadedImage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.controls {
    width: 100%;
    max-width: 500px;
    display: flex;
    gap: 10px;
}

button {
    padding: 12px 20px;
    border: none;
    background: #111184; /* Green button */
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    flex: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    background: #111184; /* Darker green */
    transform: translateY(-1px);
}

button:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

button.secondary {
    background: #6c757d;
}

button.secondary:hover {
    background: #5a6268;
}

.results {
    width: 100%;
    max-width: 500px;
    margin-top: 15px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.results h2 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #111184; /* Green text */
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-list {
    list-style: none;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.results-list li {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
}

.confidence {
    font-weight: bold;
    color: #111184; /* Green text */
}

#fileInput {
    display: none;
}

footer {
    text-align: center;
    padding: 15px;
    background: #343a40;
    color: white;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    h1 { font-size: 1.4rem; }
    .subtitle { font-size: 0.9rem; }
    .mode-btn { padding: 12px; font-size: 0.9rem; }
    button { padding: 10px 15px; font-size: 0.9rem; }
}

/* Loading spinner */
.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;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}