:root {
    --bg-dark: #1b2630;
    --bg-panel: #212d38;
    --bg-nav: #161f28;
    --accent: #2ca197;
    --accent-hover: #36c5b9;
    --text-primary: #d9e2ec;
    --text-secondary: #829ab1;
    --border-color: #2b3b4a;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Left Navigation */
.side-nav {
    width: 60px;
    background-color: var(--bg-nav);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid var(--border-color);
}

.nav-brand {
    padding: 20px 0;
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    text-align: center;
}

.nav-links {
    list-style: none;
    width: 100%;
    margin-top: 10px;
}

.nav-links li {
    padding: 15px 0;
    text-align: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-links li:hover {
    color: var(--text-primary);
}

.nav-links li.active {
    background-color: var(--border-color);
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 4px;
    color: white;
}

/* Gallery Panel */
.gallery-panel {
    width: 140px;
    background-color: #2b3b4a;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.gallery-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.gallery-thumbnail {
    width: 100%;
    height: 90px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, border 0.2s;
    border: 3px solid transparent;
}

.gallery-thumbnail:hover {
    opacity: 0.8;
}

.gallery-thumbnail.active {
    opacity: 1;
    border: 3px solid var(--accent);
}

.upload-container {
    padding: 20px;
    background-color: var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.upload-container:hover {
    background-color: var(--accent-hover);
}

.upload-btn-wide {
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    width: 100%;
}

/* Main Wrapper & Layout */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    background-color: var(--bg-panel);
    padding: 15px 25px;
    border-bottom: 2px solid var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.header-title h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

.header-title p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.options-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.options-btn:hover {
    color: var(--text-primary);
}

.content-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Main Workspace Area */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: 0;
    min-width: 0;
}

.image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    min-height: 0;
    min-width: 0;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

#previewImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(27, 38, 48, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    z-index: 10;
}

.loading-overlay i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Right Sidebar */
.results-sidebar {
    width: 320px;
    background-color: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-section {
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: flex 0.2s;
}

.sidebar-section:not(.collapsed) {
    flex: 1;
    overflow: hidden;
}

.sidebar-section.collapsed .section-content {
    display: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.02);
    user-select: none;
}

.section-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

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

.header-left-title h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-icon {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease-in-out;
}

.sidebar-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s;
    padding: 4px;
}

.icon-btn:hover {
    color: var(--accent);
}

.section-content {
    padding: 5px 20px 20px 20px;
    overflow-y: auto;
    flex: 1;
}

.placeholder-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Tag Results Style */
.tag-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
}

.tag-name {
    color: var(--text-primary);
}

.tag-score {
    color: var(--accent);
    font-size: 0.8rem;
}

.description-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

/* Category Progress Bars */
.category-item {
    margin-bottom: 15px;
}

.category-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.category-name {
    color: var(--text-primary);
    font-weight: 500;
}

.category-score {
    color: var(--text-secondary);
}

.category-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.category-fill {
    height: 100%;
    background-color: var(--accent);
    border-radius: 2px;
    transition: width 0.5s ease-out;
}
