/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: 'Inter', sans-serif;
    color: #fff;
}

/* Font classes for specific languages */
.lang-ml {
    font-family: 'Manjari', 'Inter', sans-serif !important;
}

.lang-hi {
    font-family: 'Noto Sans Devanagari', 'Inter', sans-serif !important;
}

/* Camera Container Background */
#camera-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Lowest */
    background-color: #111;
}

#camera-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    pointer-events: none; /* Let clicks pass through except on specific buttons */
}

/* Header */
#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    pointer-events: auto;
}

#app-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.dynamic-button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: background 0.2s, transform 0.1s;
}

.dynamic-button:active {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0.95);
}

/* Response Area */
#response-area {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    text-align: center;
    pointer-events: none;
}

.status-msg {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 18px;
    line-height: 1.4;
    transition: opacity 0.3s;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Middle Controls */
#middle-controls {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    pointer-events: auto;
    z-index: 20;
}

/* Large Capture Button */
#btn-capture {
    position: absolute;
    bottom: 0px; 
    left: 0;
    width: 100%;
    height: 60%; /* Bottom half */
    background: transparent;
    border: none;
    outline: none;
    z-index: 15; /* Above background, below stop button */
    pointer-events: auto;
    cursor: pointer;
}

#btn-capture:focus-visible {
    box-shadow: inset 0 0 0 4px #4D90FE;
    background: rgba(255, 255, 255, 0.1);
}

/* Emergency Stop Bar */
#btn-stop {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    background-color: #D32F2F; /* Deep red */
    color: white;
    font-size: 20px;
    font-weight: 700;
    border: none;
    border-top: 2px solid #F44336;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    pointer-events: auto;
    z-index: 30;
    cursor: pointer;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.5);
    transition: background-color 0.2s, transform 0.2s;
}

#btn-stop:disabled {
    background-color: #555;
    border-top: 2px solid #666;
    color: #999;
    pointer-events: none;
}

#btn-stop:active:not(:disabled) {
    background-color: #B71C1C;
}

.stop-icon {
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 2px;
}
