/* Custom styles for ITS Portal Redesign */

[data-bs-theme="dark"] {
    --bs-body-bg: #121212;
    --bs-body-color: #ffffff;
    --bs-surface: #1e1e1e;
    --bs-secondary-bg: #2d2d2d;
    --bs-tertiary-bg: #3d3d3d;
    --bs-border-color: #444444;
    --bs-secondary-color: #a0a0a0;
}

[data-bs-theme="dark"] body {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .bg-body {
    background-color: var(--bs-surface) !important;
}

[data-bs-theme="dark"] .bg-body-tertiary {
    background-color: var(--bs-body-bg) !important;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* Minimalist App Item (Card) aligned with ITATS Design System */
.app-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--bs-border-radius-lg);
    text-decoration: none !important;
    color: var(--bs-text-primary) !important;
    transition: all 0.2s ease;
    cursor: pointer;
    background: transparent;
}

[data-bs-theme="dark"] .app-item {
    color: var(--bs-body-color) !important;
}

.app-item:hover {
    background-color: var(--bs-primary-light);
    color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .app-item:hover {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color) !important;
}

.app-icon {
    width: 38px;
    height: 38px;
    margin-right: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 8px;
    font-size: 22px; /* For iconify-icon */
}

/* Microsoft-inspired Color Palette */
.icon-blue { color: #0078d4; background-color: #deecf9; }
.icon-orange { color: #d83b01; background-color: #fde7e9; }
.icon-green { color: #107c10; background-color: #dff6dd; }
.icon-purple { color: #5c2d91; background-color: #efebf6; }
.icon-red { color: #a4262c; background-color: #fed9cc; }
.icon-teal { color: #008272; background-color: #def0ee; }

[data-bs-theme="dark"] .icon-blue { background-color: rgba(0, 120, 212, 0.15); color: #2899f5; }
[data-bs-theme="dark"] .icon-orange { background-color: rgba(216, 59, 1, 0.15); color: #ff8c00; }
[data-bs-theme="dark"] .icon-green { background-color: rgba(16, 124, 16, 0.15); color: #32d732; }
[data-bs-theme="dark"] .icon-purple { background-color: rgba(92, 45, 145, 0.15); color: #b4a0ff; }
[data-bs-theme="dark"] .icon-red { background-color: rgba(164, 38, 44, 0.15); color: #ff7575; }
[data-bs-theme="dark"] .icon-teal { background-color: rgba(0, 130, 114, 0.15); color: #00f0d1; }

/* Iconify Icon tag adjustment */
iconify-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
}

/* Keep images compatible just in case */
img.app-icon {
    padding: 0;
    background-color: transparent !important;
    object-fit: contain;
}

/* Remove background/border from images, keep them clean */
.app-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.app-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-subtitle {
    font-size: 0.8125rem;
    margin: 0;
    margin-top: 3px;
    color: var(--bs-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-bs-theme="dark"] .app-subtitle {
    color: var(--bs-secondary-color);
}

/* Category Header */
.category-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-text-secondary);
    margin-top: 24px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .category-header {
    color: var(--bs-secondary-color);
    border-bottom-color: var(--bs-border-color);
}

/* Theme toggle button */
.theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--bs-body-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.theme-toggle-btn:hover {
    background-color: var(--bs-secondary-bg);
}

/* Hide items not yet active (red items from master list) */
.app-hidden {
    display: none !important;
}
@media (min-width: 992px) {
    .app-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 991.98px) {
    .app-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* Global Navbar tweak */
.navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}