/* ==========================================================================
   Indian Sign Language Translator — Web Stylesheet
   Theme: Glassmorphic Dark Apple-style
   ========================================================================== */

:root {
    --bg-color: #070714;
    --glass-1: #0d0d20;
    --glass-2: #12122a;
    --border: #1f1f45;
    --border-bright: #3a3a80;
    --accent: #7b6fff;
    --accent-dark: #5548cc;
    --teal: #00d4aa;
    --teal-dark: #009977;
    --danger: #ff4466;
    --danger-bg: #1f0a12;
    --text: #eeeeff;
    --text-dim: #6666aa;
    --text-bright: #ffffff;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.app-container {
    width: 100vw;
    max-width: 1440px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    background-color: var(--bg-color);
}

/* --- Header --- */
.app-header {
    background: var(--glass-1);
    border-bottom: 1px solid var(--border);
    height: 70px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 28px;
}

.app-header h1 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 400;
    margin-left: 10px;
    font-family: var(--font-sans);
}

.header-right {
    display: flex;
    align-items: center;
}

.status-indicator {
    background: rgba(0, 212, 170, 0.08);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 20px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--teal);
    display: inline-block;
}

.pulse-teal {
    box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.7);
    animation: pulse 1.6s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse {
    to {
        box-shadow: 0 0 0 8px rgba(0, 212, 170, 0);
    }
}

.status-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--teal);
    letter-spacing: 0.5px;
}

/* --- Main Layout --- */
.app-body {
    flex: 1;
    display: grid;
    grid-template-columns: 550px 1fr;
    gap: 16px;
    padding: 16px;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .app-body {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
}

.feed-column, .control-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.feed-column {
    height: 100%;
    overflow-y: auto;
}

/* --- Card Styles --- */
.card {
    background: var(--glass-1);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: border-color 0.3s ease;
}

.card:hover {
    border-color: rgba(123, 111, 255, 0.25);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.card-header h2 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.icon-dim {
    width: 16px;
    height: 16px;
    color: var(--text-dim);
}

/* --- Camera Feed --- */
.canvas-container {
    position: relative;
    width: 100%;
    background-color: #050510;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

#camera-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Loading Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 7, 20, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(123, 111, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
}

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

#loading-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
}

/* --- Skeleton Container --- */
.skeleton-card {
    flex: 1;
    min-height: 280px;
    align-items: center;
}

.skeleton-container {
    width: 230px;
    height: 230px;
    background-color: #050510;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#skeleton-canvas {
    width: 100%;
    height: 100%;
}

/* --- Control Column --- */

/* Detected Character Card */
.char-display-row {
    display: flex;
    align-items: center;
    gap: 24px;
}

.char-glyph {
    font-family: var(--font-display);
    font-size: 80px;
    font-weight: 800;
    color: var(--accent);
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-shadow: 0 0 20px rgba(123, 111, 255, 0.35);
}

.conf-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.conf-title {
    font-size: 12px;
    color: var(--text-dim);
}

.conf-value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    color: var(--teal);
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background-color: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--teal);
    border-radius: 4px;
    width: 0%;
    transition: width 0.15s ease-out;
}

.gesture-hints {
    display: flex;
    gap: 12px;
    font-size: 10px;
    color: var(--text-dim);
}

/* Sentence Card */
.sentence-card {
    flex: 1;
}

.sentence-display {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dim);
    line-height: 1.4;
    word-break: break-word;
    height: 100%;
    min-height: 100px;
    display: flex;
    align-items: flex-start;
    padding: 6px 0;
}

.sentence-display.active {
    color: var(--text-bright);
}

.flash-char {
    color: var(--teal);
    animation: flash 0.3s ease-out;
}

@keyframes flash {
    0% { transform: scale(1.2); color: #00ff99; }
    100% { transform: scale(1.0); color: var(--text-bright); }
}

/* Suggestions Card */
.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (max-width: 600px) {
    .suggestions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sugg-btn {
    background: var(--glass-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    padding: 12px 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: capitalize;
}

.sugg-btn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(123, 111, 255, 0.4);
    transform: translateY(-1px);
}

.sugg-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

/* Controls Row */
.controls-row {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    border-radius: 14px;
    height: 54px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent);
    border: none;
    color: var(--text-bright);
}

.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: 0 0 16px rgba(123, 111, 255, 0.3);
    transform: translateY(-1px);
}

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

.btn-danger {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: var(--text-bright);
    box-shadow: 0 0 16px rgba(255, 68, 102, 0.3);
    transform: translateY(-1px);
}

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

/* --- Footer Bar --- */
.app-footer-bar {
    background: var(--glass-1);
    border-top: 1px solid var(--border);
    height: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.status-msg {
    font-size: 10px;
    color: var(--text-dim);
}

.app-version {
    font-size: 10px;
    color: var(--text-dim);
}
