:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.5);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.5);
    --warning: #f59e0b;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --blob-1: #3b82f6;
    --blob-2: #8b5cf6;
    --blob-3: #ec4899;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Animations */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at center, var(--bg-dark) 0%, var(--bg-darker) 100%);
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    border-radius: 50%;
    animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
    width: 40vw;
    height: 40vw;
    background: var(--blob-1);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.blob-2 {
    width: 35vw;
    height: 35vw;
    background: var(--blob-2);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.blob-3 {
    width: 30vw;
    height: 30vw;
    background: var(--blob-3);
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(5%, 10%) scale(1.1); }
    66% { transform: translate(-5%, 5%) scale(0.9); }
    100% { transform: translate(10%, -5%) scale(1); }
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Header */
.header-content {
    width: 100%;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.time-display {
    font-size: 1.5rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

/* Buttons */
.btn-primary, .btn-success, .btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
}

.glow-effect:hover {
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-success.glow-effect:hover {
    box-shadow: 0 0 20px var(--success-glow);
}

.btn-primary:active, .btn-success:active, .btn-secondary:active {
    transform: translateY(1px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.full-width {
    width: 100%;
}

/* Layout */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
}

.mobile-container {
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.8);
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
}

.text-red { color: #f87171; text-shadow: 0 0 15px rgba(248, 113, 113, 0.4); }
.content-grid {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    min-height: 600px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Monitor Grid */
.findings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.5rem;
    height: 100%;
}

.grid-item {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.grid-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid var(--glass-border);
    z-index: 10;
}

.grid-item-section {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
}

.compare-view {
    display: flex;
    flex: 1;
    gap: 0.5rem;
    padding: 0.5rem;
    height: calc(100% - 45px); /* Minus header */
}

.image-container {
    flex: 1;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-label {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0,0,0,0.7);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
    z-index: 5;
}

.label-before { color: var(--danger); border: 1px solid var(--danger); }
.label-after { color: var(--success); border: 1px solid var(--success); }

/* Image Description Overlays */
.image-desc-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem 0.5rem 0.5rem 0.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0.7), transparent);
    color: var(--text-main);
    font-size: 0.85rem;
    line-height: 1.2;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.image-desc-bar strong {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.1rem;
}

.desc-before strong { color: var(--danger); }
.desc-after strong { color: var(--success); }

/* Finding List Mobile overrides if needed */

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-open { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.5); }
.status-resolved { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.5); }

/* =========================================
   Mobile Input View Styles
   ========================================= */

.mobile-container {
    max-width: 600px;
    padding: 1rem;
}

.mobile-header .header-content {
    padding: 1rem;
}

.mobile-header h1 {
    font-size: 1.5rem;
}

.back-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

.form-panel {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input[type="text"], select, textarea {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

select option {
    background: var(--bg-dark);
    color: var(--text-main);
}

.image-upload-area {
    width: 100%;
    min-height: 200px;
    background: rgba(0,0,0,0.2);
    border: 2px dashed var(--glass-border);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.image-upload-area:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.upload-placeholder .icon {
    font-size: 2rem;
}

.image-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.mt-20 { margin-top: 20px; }
.mt-15 { margin-top: 15px; }

/* Mobile Finding List */
.mobile-finding-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-list-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--danger); /* Highlight open items */
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.mobile-list-item:active {
    transform: scale(0.98);
}

.mobile-list-item-thumb {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
}

.mobile-list-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal h2 {
    margin-bottom: 0.5rem;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 0.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Bottom Navigation Tabs */
.bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    z-index: 100;
    padding: 0.5rem 0;
    justify-content: space-around;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.5);
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    gap: 0.25rem;
    flex: 1;
    padding: 0.5rem;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-tab.active {
    color: var(--primary);
}

.nav-tab .icon {
    font-size: 1.5rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsiveness */
@media (max-width: 1200px) {
    .findings-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .findings-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        overflow-y: auto;
    }
    .content-grid {
        height: auto;
    }
}

/* =========================================
   New/Improve UI Styles for Mobile Input
   ========================================= */

.action-tab-btn {
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: bold;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.action-tab-btn.active {
    opacity: 1;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.draft-card, .match-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
}

.draft-img-container, .match-img-container {
    width: 100%;
    height: 150px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.draft-img-container img, .match-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.draft-remove-btn, .match-remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.draft-comment-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-main);
    resize: none;
    font-family: inherit;
}

.draft-comment-input:focus {
    outline: none;
    border-color: var(--primary);
}

.match-selector {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--warning);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-main);
}

/* Mobile Grid overrides for 3x2 */
.mobile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    height: calc(100vh - 250px);
}

@media (max-width: 900px) {
    .mobile-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .mobile-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
        overflow-y: auto;
    }
}
