﻿html,
body {
    font-family: sans-serif;
    font-size: 18px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    background: url("images/entityguard_logo.png") no-repeat center center fixed;
    background-size: cover;
    height: 100%;
    mask-mode: alpha;
}

:root {
    --color-primary: #007bff;
    --color-primary-dark: #0056b3;
    --color-surface-dark: rgba(33, 37, 41, 0.95);
    --color-surface-subtle: rgba(255, 255, 255, 0.05);
    --color-border-light: rgba(255, 255, 255, 0.1);
    --color-border-subtle: rgba(255, 255, 255, 0.08);
    --color-text-light: #ffffff;
    --color-text-muted: rgba(255, 255, 255, 0.7);
    --color-success: #28a745;
    --color-danger: #dc3545;
    --color-warning: #ffc107;
    --color-info: #17a2b8;
}

a,
.btn-link {
    color: var(--color-primary);
}

.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;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type="checkbox"]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

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

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

/* Button variants moved to component-scoped styles (EntityGrid.razor.css) to avoid
   global overrides and ensure component encapsulation. */

/* --- Global Component Base Classes --- */

/* Base Card Container - Flex/Grid layout base */
.eg-card-container {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
}

/* Base Card - Common visual styles */
.eg-card {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Hover effect for cards that should be interactive */
.eg-card-interactive:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.custom-grid .e-toolbar {
    position: sticky;
    height: 80vh;
    top: 0;
    z-index: 1000; /* Ensures it stays above other elements */
}

.button-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    align-items: center;
}

@media (max-width: 500px) {
    .button-row {
        flex-wrap: wrap;
    }
}

.validation-message {
    color: #e50000;
}

.e-dateRed {
    background-color: red;
}

.e-dateYellow {
    background-color: yellow;
}

.e-dateOK {
    background-color: green;
}

.add-button {
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    width: 60em;
    align-content: center;
}

.y-button {
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
}

.e-listview.e-control {
    border: 1px solid black;
}

.e-list-item-header {
    font-weight: bold;
    font-size: 18px;
}

.e-list-content {
    font-size: 18px;
}

@media (max-width: 500px) {
    .button-row {
        flex-wrap: wrap;
    }
}

/* Page header with improved readability */
.page-header {
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.page-title {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    margin: 0;
    letter-spacing: -0.025em;
}

/* Enhanced Bootstrap buttons with softer colors */
.btn-enhanced {
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-enhanced:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-enhanced:active {
    transform: translateY(0);
}

.btn-primary.btn-enhanced {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.btn-secondary.btn-enhanced {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.btn-success.btn-enhanced {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.btn-danger.btn-enhanced {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.btn-outline-primary.btn-enhanced {
    color: #3498db;
    border: 2px solid #3498db;
    background: transparent;
}

.btn-outline-primary.btn-enhanced:hover {
    background: #3498db;
    color: white;
}

/* Filter and search container */
.filter-container {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Entity grid container wrapper */
/* Entity grid container styling removed - starting fresh */

/* Entity List Container moved to EntityGrid.razor.css */

/* Grid Container Styling moved to EntityGrid.razor.css */

/* Syncfusion Grid Layout moved to EntityGrid.razor.css */

@media (max-width: 500px) {
    .button-row {
        flex-wrap: wrap;
    }
}

@media (max-width: 500px) {
    .button-row {
        flex-wrap: wrap;
    }
}

/* Dashboard Styles */
.dashboard-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content .dashboard-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-content .dashboard-title i {
    color: #007bff;
    font-size: 2.2rem;
}

.dashboard-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin: 0;
    font-weight: 400;
}

.dashboard-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.action-btn i {
    font-size: 1.1rem;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading-container .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

.loading-container p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin: 0;
}

.metric-icon {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.metric-content h3 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    line-height: 1.2;
}

.metric-label {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0.25rem 0 0.5rem 0;
    font-weight: 500;
}

.metric-change {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.metric-change.positive {
    color: #28a745;
}

.metric-change.negative {
    color: #dc3545;
}

.metric-change.info {
    color: #17a2b8;
}

.metric-change i {
    font-size: 0.9rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.chart-header h4 {
    margin: 0;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
}

.chart-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 0.25rem 0 0 0;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.chart-wrapper {
    height: 300px;
    position: relative;
}

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

.section-header h4 {
    margin: 0;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.activity-icon {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.25rem;
    width: 20px;
    text-align: center;
}

.activity-content {
    flex: 1;
}

.activity-text {
    margin: 0 0 0.25rem 0;
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1.4;
}

.activity-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.activity-action {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.activity-action:hover {
    background: rgba(255, 255, 255, 0.1);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.empty-state p {
    margin: 0;
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn.primary {
    border-left: 3px solid #007bff;
}
.action-btn.success {
    border-left: 3px solid #28a745;
}
.action-btn.info {
    border-left: 3px solid #17a2b8;
}
.action-btn.secondary {
    border-left: 3px solid #6c757d;
}

/* Animation for loading states */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-container > * {
    animation: fadeIn 0.5s ease-out;
}

.dashboard-container > *:nth-child(1) {
    animation-delay: 0.1s;
}
.dashboard-container > *:nth-child(2) {
    animation-delay: 0.2s;
}
.dashboard-container > *:nth-child(3) {
    animation-delay: 0.3s;
}
.dashboard-container > *:nth-child(4) {
    animation-delay: 0.4s;
}

/* Chart Dark Theme Overrides */
.chart-wrapper .e-chart {
    background: #1a1a1a !important;
    border-radius: 8px;
}

.chart-wrapper .e-chart text {
    fill: rgba(255, 255, 255, 0.9) !important;
}

.chart-wrapper .e-chart .e-axis-label {
    fill: rgba(255, 255, 255, 0.8) !important;
}

.chart-wrapper .e-chart .e-axis-title {
    fill: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600 !important;
}

.chart-wrapper .e-chart .e-legend-text {
    fill: rgba(255, 255, 255, 0.9) !important;
}

.chart-wrapper .e-chart .e-chart-tooltip {
    background: rgba(33, 37, 41, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.chart-wrapper .e-chart .e-chart-tooltip text {
    fill: #ffffff !important;
}

/* Enhanced chart styling with dark theme colors */
.chart-wrapper .e-chart .e-series path {
    stroke: #007bff !important;
    fill: #007bff !important;
}

.chart-wrapper .e-chart .e-column {
    stroke-width: 2px !important;
    stroke: rgba(255, 255, 255, 0.3) !important;
}

/* Specific colors for compliance chart categories */
.chart-wrapper .e-chart .e-series:nth-child(1) path {
    fill: #dc3545 !important; /* Red for overdue */
}

.chart-wrapper .e-chart .e-series:nth-child(2) path {
    fill: #ffc107 !important; /* Yellow for due soon */
}

.chart-wrapper .e-chart .e-series:nth-child(3) path {
    fill: #28a745 !important; /* Green for upcoming */
}

/* Blue colors for due dates chart */
.chart-wrapper .e-chart .e-column[fill="#007bff"] {
    fill: #007bff !important;
}

.chart-wrapper .e-chart .e-column[fill="#007bff"]:hover {
    fill: #0056b3 !important;
}

/* Pie chart specific styling */
.chart-wrapper .e-chart .e-pie {
    stroke-width: 2px !important;
    stroke: rgba(255, 255, 255, 0.2) !important;
}

.chart-wrapper .e-chart .e-pie:hover {
    stroke-width: 3px !important;
    stroke: rgba(255, 255, 255, 0.5) !important;
}

/* Grid lines - keep default but style for dark theme */
.chart-wrapper .e-chart .e-major-gridline {
    stroke: rgba(255, 255, 255, 0.1) !important;
    stroke-width: 1px !important;
}

.chart-wrapper .e-chart .e-minor-gridline {
    stroke: rgba(255, 255, 255, 0.05) !important;
    stroke-width: 0.5px !important;
}

/* Axis lines */
.chart-wrapper .e-chart .e-axis-line {
    stroke: rgba(255, 255, 255, 0.3) !important;
    stroke-width: 1px !important;
}

/* Dark theme specific overrides */
.chart-wrapper .e-chart[data-bs-theme="dark"] {
    background: #1a1a1a !important;
}

.chart-wrapper .e-chart[data-bs-theme="dark"] .e-axis-label {
    fill: rgba(255, 255, 255, 0.8) !important;
}

.chart-wrapper .e-chart[data-bs-theme="dark"] .e-axis-title {
    fill: rgba(255, 255, 255, 0.9) !important;
}

/* Grid Action Buttons moved to EntityGrid.razor.css */

/* Responsive layout adjustments for smaller screens */
@media (max-width: 768px) {
    /* Reduce main content padding on tablets */
    .main-content .content {
        padding-left: 0.75rem !important; /* Reduce from Bootstrap's px-4 (1.5rem) */
        padding-right: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    /* Further reduce main content padding on mobile */
    .main-content .content {
        padding-left: 0.5rem !important; /* Even less padding on mobile */
        padding-right: 0.5rem !important;
    }
}

/* Remove width constraints that prevent horizontal scrolling */
.layout-container .main-content .content.px-4 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    /* Remove max-width and overflow-x constraints */
}

/* Allow grid to expand naturally and show horizontal scrollbar when needed */
/* Entity grid content styling removed - starting fresh */

.page-heading {
    margin-top: 2rem;
}

/* Modal-specific dark-theme overrides ----------------------------------
   Ensure form controls inside `.modal` match the app's dark theme: dark
   background with light text for better visual consistency and accessibility.
   Scoped to modals to avoid changing global form styles.
*/
.modal .form-control,
.modal .form-select {
    color: var(--color-text-light) !important;
    background-color: var(--color-surface-dark) !important;
    border-color: var(--color-border-subtle) !important;
}

.modal .form-select option {
    color: var(--color-text-light) !important;
    background-color: var(--color-surface-dark) !important;
}

/* Debug Panel - Dark theme with light text */
.debug-panel {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #404040;
}

.debug-panel .card-header {
    background-color: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-bottom: 1px solid #404040;
}

.debug-panel .card-body {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.debug-panel code {
    background-color: #0d0d0d;
    color: #00ff88;
    padding: 12px;
    border-radius: 4px;
    display: block;
    font-size: 0.85rem;
    line-height: 1.5;
    border: 1px solid #404040;
}

.debug-panel small {
    color: #b0b0b0;
}
