body {
    background: #222;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

p {
    margin: 8px 0;
    &.small-text {
        font-size: 11px;
        margin: 8px 0 16px 0;
    }
}

#video-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

video {
    max-width: 1280px;
    max-height: 720px;
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    border: none;
    display: block;
    position: relative;
    border-radius: 10px;
}

/* Remove size limits when in fullscreen */
#video-container:fullscreen video {
    max-width: none;
    max-height: none;
}

#detection-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.85);
    padding: 15px;
    border-radius: 8px;
    width: 350px;
    max-height: 80%;
    overflow-y: auto;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

#detection-overlay:has(.overlay-title.hidden) {
    background: transparent;
    padding: 0;
    width: auto;
    overflow: visible;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #4CAF50;
}

#detection-overlay:has(.overlay-title.hidden) .overlay-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

#detections {
}

.overlay-title {
    font-size: 18px;
    font-weight: bold;
    color: #4CAF50;
}

.bird-detection {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(76, 175, 80, 0.15);
    border-left: 3px solid #4CAF50;
    border-radius: 4px;
}

.bird-species {
    font-size: 16px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 5px;
}

.bird-scientific {
    font-size: 12px;
    color: #aaa;
    font-style: italic;
    margin-bottom: 8px;
}

.bird-info {
    font-size: 12px;
    color: #ddd;
    margin: 3px 0;
}

.confidence-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.confidence-high {
    background: rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.confidence-medium {
    background: rgba(255, 193, 7, 0.3);
    color: #FFC107;
}

.confidence-low {
    background: rgba(255, 152, 0, 0.3);
    color: #FF9800;
}

.no-detection {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.analyzing-in-progress {
    color: #FFC107;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.detection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.detection-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.hidden {
    display: none !important;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

.status-active .status-dot {
    background: #4CAF50;
}

.status-inactive .status-dot {
    background: #f44336;
    animation: none;
}

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

.timestamp {
    font-size: 11px;
    color: #888;
    margin-top: 10px;
    text-align: center;
    border-top: 1px solid #444;
    padding-top: 8px;
}

#reset-button {
    width: 100%;
    margin-top: 10px;
    padding: 8px 16px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#reset-button:hover {
    background: #d32f2f;
}

#reset-button:active {
    transform: scale(0.98);
}

.bird-location {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.bird-description {
    font-size: 12px;
    color: #ccc;
    margin-top: 5px;
    line-height: 1.4;
}

.captured-image {
    width: 100%;
    border-radius: 6px;
    margin-top: 15px;
    border: 1px solid #444;
}

#analyze-button {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 10;
}

#analyze-button:hover {
    background: #45a049;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

#analyze-button:active {
    transform: translateX(-50%) translateY(0);
}

#analyze-button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

#analyze-button.analyzing {
    background: #FF9800;
}

#capture-button,
#fullscreen-button {
    position: absolute;
    bottom: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

#capture-button {
    right: 60px; /* Position à gauche du bouton fullscreen */
}

#fullscreen-button {
    right: 10px;
}

#capture-button:hover,
#fullscreen-button:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

#capture-button:active,
#fullscreen-button:active {
    transform: translateY(0);
}

/* Selection overlay styles */
#selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#selection-canvas {
    max-width: 90vw;
    max-height: 80vh;
    cursor: crosshair;
    border: 2px solid #4CAF50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

#selection-instructions {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 2px solid #4CAF50;
}

.selection-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

#cancel-selection,
#validate-selection {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#cancel-selection {
    background: #f44336;
    color: white;
}

#cancel-selection:hover {
    background: #d32f2f;
}

#validate-selection {
    background: #4CAF50;
    color: white;
}

#validate-selection:hover {
    background: #45a049;
}

#validate-selection:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Capture Preview Overlay */
.capture-preview {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    padding: 12px;
    width: 250px;
    backdrop-filter: blur(10px);
    border: 2px solid #4CAF50;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    z-index: 100;
    animation: slideInFromLeft 0.3s ease;
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.capture-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #4CAF50;
}

.capture-timer {
    font-size: 12px;
    color: #FFC107;
    background: rgba(255, 193, 7, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.capture-preview-image {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #444;
}

.capture-preview-actions {
    display: flex;
    gap: 8px;
}

.capture-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.download-btn {
    background: #4CAF50;
    color: white;
}

.download-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.delete-btn {
    background: #000;
    color: white;
}

.delete-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.capture-action-btn:active {
    transform: translateY(0);
}

/* Mobile responsiveness - hide detection UI on small screens */
@media (max-width: 992px) {
    #analyze-button {
        display: none !important;
    }

    #detection-overlay {
        display: none !important;
    }

    #detection-status {
        display: none !important;
    }
}
