@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

:root {
    --rz-primary: #0a304e !important;
    --rz-secondary: #f27422 !important;
    --rz-icon-font-family: 'Material Symbols Outlined' !important;
    --background-dark: rgb(248, 250, 253);
}

.material-icons {
    font-family: var(--rz-icon-font-family) !important;
}

html, body {
    font-family: Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-dark);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41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2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* Main Layout */

.main-layout-page {
    height: calc(100vh - 64px);
    display: grid;
    grid-template-columns: auto 0px;
    grid-gap: 0px;
    padding: 16px;
}

.main-layout-page > div:last-child {
    display: none;
}

.main-layout-page[details] {
    grid-template-columns: auto 350px;
    grid-gap: 16px;
}

.main-layout-page[details] > div:last-child {
    display: block;
}

.main-layout-page hr {
    margin: 8px -16px;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.main-layout-page-container {
    background-color: white;
    margin: 0;
    padding: 16px;
    border-radius: 16px;
    position: relative;
    top: 0px;
    bottom: 0px;
    overflow: auto;
}

/* Main Navigation Menu */
.mdc-drawer {
    background-color: var(--background-dark);
}

.main-navigation .mdc-list-item {
    display: grid;
    grid-template-columns: 48px auto;
    margin: 4px 8px;
    height: 48px;
}

.main-navigation .mdc-list-item:first-of-type {
    margin-top: 4px;
}

.main-navigation .mdc-list-item:hover::before {
    content: "";
    position: absolute;
    background-color: var(--mdc-theme-primary);
    opacity: 0.16;
    width: 100%;
    height: 100%;
}

.main-navigation .mdc-list-item span {
    display: flex;
    align-items: center;
}

.main-navigation .mdc-list-item--selected::before {
    background-color: var(--mdc-theme-primary, #0a304e);
    opacity: 0.32;
}

.main-navigation .mdc-list-item--selected {
    color: var(--mdc-theme-primary, #0a304e) !important;
}

.main-navigation .mdc-list-item--selected img {
    filter: opacity(0.5) drop-shadow(0px 0px 0px var(--mdc-theme-primary, #0a304e));
}

/* Grid */
.grid-header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    font-family: Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    height: 50px;
}

.grid-header-actions {
    background: white;
    display: flex;
    align-items: center;
    height: 50px;
    font-size: 14px;
    font-weight: 500;
    position: sticky;
    top: -16px;
    z-index: 100;
}

.grid-header-actions:before {
    content: "";
    position: absolute;
    background-color: rgb(240, 244, 249);
    border-radius: 1.5rem;
    height: 100%;
    width: 100%;
    z-index: -50;
}

.grid-header-actions .mdc-icon-button {
    width: 40px;
    font-size: 20px;
    --mdc-ripple-fg-scale: 1 !important;
    --mdc-ripple-fg-size: 30px !important;
    --mdc-ripple-left: 5px !important;
    --mdc-ripple-top: 9px !important;
    padding-left: 4px;
    padding-right: 4px;
}

.grid-header-actions .material-icons {
    font-size: 20px;
}

.grid-header-label {
    margin-right: 16px;
}

.rz-data-grid {
    border: none;
}

/* Property Group Styles */
.detail-parameter-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow: auto;
}

.detail-parameter-list h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.detail-parameter-list .property-group {
    display: flex;
    flex-direction: column;
}

.detail-parameter-list .property-group span:first-child {
    font-size: .75rem;
    font-weight: 500;
}

.detail-parameter-list .property-group span:last-child {
    font-size: 0.875rem;
    font-weight: 400;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.available {
    background-color: #4caf50;
    color: white;
}

.status-badge.assigned {
    background-color: #2196f3;
    color: white;
}

.status-badge.reserved {
    background-color: #9e9e9e;
    color: white;
}

.status-badge.draining {
    background-color: #ff9800;
    color: white;
}

.status-badge.creating {
    background-color: #00bcd4;
    color: white;
}

.status-badge.pending {
    background-color: #00bcd4;
    color: white;
}

.status-badge.running {
    background-color: #4caf50;
    color: white;
}

.status-badge.failed {
    background-color: #f44336;
    color: white;
}

.status-badge.stopping {
    background-color: #ff9800;
    color: white;
}

.status-badge.stopped {
    background-color: #9e9e9e;
    color: white;
}

/* Flex Utilities */
.flex-column-gap1 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.flex-row-gap1 {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

/* Font Monospace */
.font-monospace {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
}

/* Instance List in Details Panel */
.instance-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.instance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.instance-item .instance-name {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
}

/* Text muted utility */
.text-muted {
    color: #6c757d;
}

/* Dashboard Styles */
.dashboard-container {
    padding: 16px;
    height: calc(100vh - 64px);
    overflow: auto;
}

.dashboard-container h3 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 500;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 8px;
}

.error-container {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 40px auto;
}

.error-container h1 {
    color: #d32f2f;
    margin-bottom: 20px;
}

.error-container p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.logout-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0a304e;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
}

.logout-link:hover {
    background-color: #f27422;
}

/* Statistics Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background-color: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon .material-icons,
.stat-icon .mdc-icon {
    font-size: 24px;
    color: white;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
}

/* Stat Card Colors */
.stat-card.available .stat-icon {
    background-color: #4caf50;
}

.stat-card.assigned .stat-icon {
    background-color: #2196f3;
}

.stat-card.reserved .stat-icon {
    background-color: #9e9e9e;
}

.stat-card.draining .stat-icon {
    background-color: #ff9800;
}

.stat-card.total .stat-icon {
    background-color: #0a304e;
}

/* Image Statistics Card */
.image-stats-card {
    background-color: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

/* Room Statistics Section */
.room-stats-section {
    margin-bottom: 24px;
}

.room-stats-section h3 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 500;
}

/* Device Statistics Section */
.device-stats-section {
    margin-bottom: 24px;
}

.device-stats-section h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.last-updated {
    font-size: 0.75rem;
}

/* Smaller stats grid for single cards */
.stats-grid-small {
    grid-template-columns: repeat(auto-fit, minmax(180px, 200px));
}

/* Stats Tables Row */
.stats-tables-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 992px) {
    .stats-tables-row {
        grid-template-columns: 1fr;
    }
}

/* Stats Table Card */
.stats-table-card {
    background-color: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stats-table-card h4 {
    margin: 0 0 12px 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #666;
}

/* Room and Device Stat Card Colors */
.stat-card.rooms .stat-icon {
    background-color: #673ab7;
}

.stat-card.devices .stat-icon {
    background-color: #e91e63;
}

/* No Data Message */
.no-data-message {
    padding: 16px;
    text-align: center;
    background-color: white;
    border-radius: 8px;
    margin-top: 16px;
}

/* Service Status Dialog */
.dialog-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.dialog-stat-card {
    background-color: #f8fafe;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dialog-stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dialog-stat-card .stat-icon .material-icons {
    font-size: 20px;
    color: white;
}

.dialog-stat-card .stat-content {
    display: flex;
    flex-direction: column;
}

.dialog-stat-card .stat-value {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.2;
}

.dialog-stat-card .stat-label {
    font-size: 0.75rem;
    color: #666;
}

.dialog-section {
    margin-bottom: 20px;
}

.dialog-section h3 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--rz-primary);
}

.metrics-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.metrics-row:last-child {
    border-bottom: none;
}

.metrics-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.metrics-value {
    font-size: 0.8rem;
    font-weight: 400;
    font-family: 'Consolas', 'Monaco', monospace;
}

.no-metrics {
    text-align: center;
    padding: 32px 16px;
    color: #999;
    font-size: 0.875rem;
    font-style: italic;
}

.health-badge-large {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.health-badge-large.healthy {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.health-badge-large.degraded {
    background-color: #fff3e0;
    color: #e65100;
}

.health-badge-large.unhealthy {
    background-color: #ffebee;
    color: #c62828;
}

.error-highlight {
    background-color: #fff8e1;
    border-left: 3px solid #ff9800;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    margin-top: 8px;
}

.error-highlight.recent {
    background-color: #ffebee;
    border-left-color: #f44336;
}

.error-highlight .error-message-text {
    font-size: 0.8rem;
    font-family: 'Consolas', 'Monaco', monospace;
    word-break: break-word;
}

.error-highlight .error-timestamp {
    font-size: 0.7rem;
    color: #999;
    margin-top: 4px;
}
