/* === Base === */
html, body {
    height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f3f2f1;
    color: #323130;
}

.text-accent {
    color: #0078d4 !important;
}

/* === Icon Buttons === */
.icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: #605e5c;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    font-size: 1rem;
}

.icon-btn:hover {
    background: #e1dfdd;
    color: #323130;
}

/* === App Container === */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Top Bar === */
.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 48px;
    background: #fff;
    border-bottom: 1px solid #e1dfdd;
    flex-shrink: 0;
}

/* === Search Bar === */
.search-bar {
    background: #faf9f8;
    border-bottom: 1px solid #edebe9;
    flex-shrink: 0;
}

/* === Content Area === */
.content-area {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* === List Panel === */
.list-panel {
    width: 420px;
    min-width: 320px;
    border-right: 1px solid #e1dfdd;
    background: #fff;
    overflow-y: auto;
    flex-shrink: 0;
}

.list-items {
    padding: 4px 0;
}

.list-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f2f1;
    transition: background 0.15s;
}

.list-item:hover {
    background: #faf9f8;
}

.list-item.active {
    background: #e7f1ff;
    border-left: 3px solid #0078d4;
    padding-left: 13px;
}

.item-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #323130;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-subtitle {
    font-size: 0.8rem;
    color: #605e5c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-rating {
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* === Media Type Icons === */
.media-type-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.media-type-icon.type-0 {
    background: #e8f5e9;
    color: #2e7d32;
}

.media-type-icon.type-1 {
    background: #e3f2fd;
    color: #1565c0;
}

.media-type-icon.type-2 {
    background: #fce4ec;
    color: #c62828;
}

.media-type-icon.type-3 {
    background: #fff3e0;
    color: #e65100;
}

.media-type-icon.type-4 {
    background: #ede7f6;
    color: #4527a0;
}

/* === Detail Panel === */
.detail-panel {
    flex: 1;
    overflow-y: auto;
    background: #faf9f8;
}

.detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-header {
    padding: 20px 24px;
    background: #fff;
    border-bottom: 1px solid #edebe9;
}

.detail-body {
    padding: 20px 24px;
}

.detail-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-field label,
.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #a19f9d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-field span {
    font-size: 0.9rem;
    color: #323130;
}

/* === Type Badges === */
.bg-type-0 { background: #2e7d32 !important; color: #fff !important; }
.bg-type-1 { background: #1565c0 !important; color: #fff !important; }
.bg-type-2 { background: #c62828 !important; color: #fff !important; }
.bg-type-3 { background: #e65100 !important; color: #fff !important; }
.bg-type-4 { background: #4527a0 !important; color: #fff !important; }

/* === Landing Page === */
.landing-page {
    background: linear-gradient(180deg, #fff 0%, #f3f2f1 100%);
    min-height: calc(100vh - 56px);
}

/* === FAB === */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #0078d4;
    color: #fff;
    border: none;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 100;
}

.fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 120, 212, 0.5);
}

/* === Mobile === */
.mobile-container {
    display: none !important;
    flex-direction: column;
    height: 100vh;
}

.mobile-view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.mobile-view.active {
    display: flex;
}

.mobile-detail-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    height: 48px;
    background: #fff;
    border-bottom: 1px solid #e1dfdd;
    flex-shrink: 0;
}

.mobile-detail-topbar .fw-semibold {
    flex: 1;
}

/* === Modal overrides === */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #edebe9;
}

.modal-footer {
    border-top: 1px solid #edebe9;
}

/* === Form Controls === */
.form-control:focus,
.form-select:focus {
    border-color: #0078d4;
    box-shadow: 0 0 0 1px #0078d4;
}

/* === Responsive === */
@media (max-width: 768px) {
    .desktop-container {
        display: none !important;
    }

    .mobile-container {
        display: flex !important;
    }
}

/* Desktop layout flex */
.desktop-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* === Misc === */
.min-w-0 { min-width: 0; }

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Badge overrides */
.badge.bg-light {
    border: 1px solid #e1dfdd;
}

/* === Multi-select Dropdown === */
.multiselect-dropdown .dropdown-toggle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multiselect-dropdown .dropdown-menu {
    max-height: 280px;
    overflow-y: auto;
    min-width: 100%;
}

.multiselect-dropdown .dropdown-item:active {
    background: inherit;
    color: inherit;
}

.multiselect-dropdown .dropdown-item {
    cursor: pointer;
}

.multiselect-dropdown .form-check-input {
    flex-shrink: 0;
}

/* === Type Filter Tabs (Desktop) === */
.type-filter-tabs .nav-link {
    color: #605e5c;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 0.875rem;
    font-weight: 500;
}
.type-filter-tabs .nav-link:hover { background: #e1dfdd; color: #323130; }
.type-filter-tabs .nav-link.active { background: #0078d4; color: #fff; }

/* === Type Filter Tabs (Mobile) === */
.type-filter-tabs-mobile {
    background: #fff;
    border-bottom: 1px solid #edebe9;
    padding: 8px;
    overflow-x: auto;
    flex-shrink: 0;
}
.type-filter-tabs-mobile .nav { flex-wrap: nowrap; }
.type-filter-tabs-mobile .nav-link {
    padding: 4px 12px;
    font-size: 0.8rem;
}
