body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #333 url('/static/bg.jpg') center/cover no-repeat fixed;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#canvas-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
}

canvas {
    display: block;
    touch-action: none;
}

/* Voice Button Styles */
#voice-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    z-index: 1000;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#voice-btn svg {
    width: 32px;
    height: 32px;
    fill: white;
    transition: fill 0.3s ease;
}

#voice-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

#voice-btn:active, #voice-btn.active, #voice-btn.recording {
    background-color: rgba(255, 100, 100, 0.6); /* Reddish when active/recording */
    border-color: rgba(255, 100, 100, 0.8);
    transform: scale(0.95);
}

#voice-btn.recording svg {
    animation: pulse 1.5s ease-in-out infinite;
}

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

#voice-btn.loading {
    background-color: rgba(255, 200, 0, 0.6); /* Yellowish for loading */
    border-color: rgba(255, 200, 0, 0.8);
    cursor: wait;
}
#voice-btn.loading svg {
    animation: spin 1s linear infinite;
}
 
#interrupt-btn {
    position: absolute;
    right: 30px;
    bottom: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    z-index: 1000;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#interrupt-btn .interrupt-icon {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    display: inline-block;
    transform: translateY(-1px);
}

#interrupt-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

#interrupt-btn:active {
    background-color: rgba(255, 120, 120, 0.7);
    border-color: rgba(255, 120, 120, 0.9);
    transform: scale(0.95);
}

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

#voice-btn.processing {
    background-color: rgba(100, 200, 255, 0.6); /* Blueish when processing */
    border-color: rgba(100, 200, 255, 0.8);
    animation: pulse 1.5s infinite;
}

#perception-btn {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    z-index: 1000;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#perception-btn svg {
    width: 32px;
    height: 32px;
    fill: white;
    transition: fill 0.3s ease;
}

#perception-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-50%) scale(1.05);
}

#perception-btn:active, #perception-btn.active {
    background-color: rgba(100, 200, 255, 0.6);
    border-color: rgba(100, 200, 255, 0.8);
    transform: translateX(-50%) scale(0.95);
}

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

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(100, 200, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(100, 200, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(100, 200, 255, 0); }
}

#status-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 900;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Captured Thumbnail Styles */
#thumbnail-container {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 80px;
    min-height: 60px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1001; /* Above canvas but maybe below modal if any */
    transition: opacity 0.5s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#camera-feed {
    width: 100%;
    height: auto;
    display: block;
    transform: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    width: min(92vw, 360px);
    background: rgba(25, 25, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 16px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.modal-header h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
}

.option-list {
    display: grid;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.2s ease;
}

.option-item input {
    margin: 0;
}

.option-item input:checked + span {
    color: #9fe2ff;
    font-weight: 600;
}

.option-item:has(input:checked) {
    background: rgba(100, 200, 255, 0.18);
    border-color: rgba(100, 200, 255, 0.5);
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.modal-footer {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn.primary {
    background: rgba(100, 200, 255, 0.3);
    border-color: rgba(100, 200, 255, 0.6);
}
