/* style.css for Smart Photo Search */

.dashboard-container {
    display: flex;
    min-height: 750px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 0;
    gap: 1.5rem;
}

/* Sidebar */
.sidebar {
    width: 320px;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.tab-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.8rem;
    border-radius: 8px;
    text-align: left;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.tab-btn.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-primary);
    color: var(--text-main);
    font-weight: 500;
}

.ai-status {
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.ai-status.loading {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px dashed #f59e0b;
}
.ai-status.ready {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

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

.tab-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.text-sm {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.block-btn {
    width: 100%;
    display: block;
    text-align: center;
}

.action-btn {
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition-fast);
    border: 1px solid var(--glass-border);
    font-family: inherit;
    font-size: 0.95rem;
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}
.action-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
}
.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary-btn {
    background: var(--accent-secondary);
    color: white;
    border: none;
}
.primary-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* Canvas Wrapper for Training */
.preview-container {
    margin-top: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 1rem;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.canvas-wrapper img {
    width: 100%;
    display: block;
}
.canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.text-input {
    width: 100%;
    padding: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.3);
    color: var(--text-main);
    font-family: inherit;
    margin-bottom: 1rem;
}
.text-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Identities List */
.known-faces-list {
    margin-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
}
.known-faces-list h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
#identities-list {
    list-style: none;
    padding: 0;
}
#identities-list li {
    background: rgba(255,255,255,0.05);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

/* Progress Box */
.progress-box {
    margin-top: 1rem;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 8px;
}
.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.5rem 0;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-secondary);
    transition: width 0.2s;
}

/* Query Builder */
.query-row {
    margin-bottom: 1rem;
}
.query-row label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.select-input {
    appearance: none;
}
.separator {
    border: 0;
    height: 1px;
    background: var(--glass-border);
    margin: 1.5rem 0;
}

/* Main Area */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    padding: 1.5rem;
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.badge {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding-right: 0.5rem;
    flex: 1;
}
.results-grid::-webkit-scrollbar { width: 6px; }
.results-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    height: 100%;
    min-height: 300px;
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.result-card {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
    user-select: none;
}

.result-card.selected-green {
    border: 3px solid #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.result-card.rejected-red {
    border: 3px solid #ef4444;
    opacity: 0.5;
    transform: scale(0.96);
    filter: grayscale(80%);
}

.result-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.result-info {
    padding: 0.8rem;
    font-size: 0.85rem;
}
.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.tag {
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

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

@media (max-width: 900px) {
    .dashboard-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        max-height: none;
    }
    .main-area {
        min-height: 500px;
    }
}
