/**
 * Office 365 / Fluent Design System Styles
 * Centrální CSS soubor pro konzistentní vzhled napříč celou aplikací
 */

/* ========================================
   BASE STYLES
   ======================================== */

/* Prevent layout shift from scrollbar appearance/disappearance */
html {
    overflow-y: scroll; /* Always show vertical scrollbar */
    scrollbar-gutter: stable; /* Modern browsers: reserve space for scrollbar */
}

body {
    background-color: #faf9f8;
}

#content {
    background-color: #faf9f8;
}

/* ========================================
   COLORS - Office 365 Palette
   ======================================== */

:root {
    --o365-blue: #0078d4;
    --o365-blue-dark: #106ebe;
    --o365-blue-light: #deecf9;
    --o365-green: #107c10;
    --o365-red: #d13438;
    --o365-yellow: #ffc83d;
    --o365-cyan: #00bcf2;

    --o365-text-primary: #323130;
    --o365-text-secondary: #605e5c;
    --o365-bg-light: #f3f2f1;
    --o365-border: #edebe9;
    --o365-border-dark: #c8c6c4;
}

/* ========================================
   PAGE HEADERS
   ======================================== */

.admin-header,
.admin-account-header,
.dashboard-header,
.index-header {
    background: var(--o365-blue);
    color: white;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--o365-blue-dark);
}

.admin-header h2,
.admin-account-header h2,
.dashboard-header h2,
.index-header h2 {
    margin: 0;
    font-weight: 600;
    font-size: 2rem;
    letter-spacing: -0.02em;
}

.index-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

/* ========================================
   SECTION TITLES
   ======================================== */

.admin-section-title,
.news-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--o365-text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.admin-section-title i,
.news-section-title i {
    color: var(--o365-blue);
    margin-right: 0.5rem;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-o365 {
    border: 2px solid var(--o365-blue);
    background: var(--o365-blue);
    color: white;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 2px;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-o365:hover {
    background: var(--o365-blue-dark);
    border-color: var(--o365-blue-dark);
    color: white;
}

.btn-o365-outline {
    border: 2px solid var(--o365-blue);
    background: white;
    color: var(--o365-blue);
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 2px;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-o365-outline:hover {
    background: var(--o365-blue-light);
    color: var(--o365-blue);
}

/* ========================================
   FILTER BUTTONS
   ======================================== */

.filter-buttons-o365,
.period-toggle {
    margin-bottom: 1.5rem;
}

.filter-buttons-o365 .btn,
.period-toggle .btn {
    border: 2px solid var(--o365-border);
    background: white;
    color: var(--o365-text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 2px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.filter-buttons-o365 .btn:hover,
.period-toggle .btn:hover {
    background: var(--o365-bg-light);
    border-color: var(--o365-border-dark);
}

.filter-buttons-o365 .btn-primary,
.filter-buttons-o365 .btn.active,
.period-toggle .btn.active {
    background: var(--o365-blue);
    color: white;
    border-color: var(--o365-blue);
}

.filter-buttons-o365 .btn-primary:hover,
.filter-buttons-o365 .btn.active:hover,
.period-toggle .btn.active:hover {
    background: var(--o365-blue-dark);
    border-color: var(--o365-blue-dark);
}

/* ========================================
   CARDS - General
   ======================================== */

.admin-card-modern,
.form-card-o365,
.news-item-o365,
.welcome-card {
    background: white;
    border: 1px solid var(--o365-border);
    border-radius: 2px;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.admin-card-modern:hover,
.news-item-o365:hover {
    box-shadow: 0 3.2px 7.2px 0 rgba(0,0,0,.132), 0 0.6px 1.8px 0 rgba(0,0,0,.108);
    border-color: var(--o365-border-dark);
}

.admin-card-header {
    background: var(--o365-bg-light);
    color: var(--o365-text-primary);
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--o365-border);
}

.form-card-o365 {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-card-o365 h4 {
    color: var(--o365-text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--o365-border);
}

/* ========================================
   ADMIN MODULE CARDS
   ======================================== */

.admin-module-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
}

.admin-module-item {
    border-bottom: 1px solid var(--o365-bg-light);
    transition: all 0.1s ease;
}

.admin-module-item:last-child {
    border-bottom: none;
}

.admin-module-item:hover {
    background: var(--o365-bg-light);
}

.admin-module-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    color: var(--o365-text-primary);
    text-decoration: none;
    transition: all 0.1s ease;
}

.admin-module-link:hover {
    color: var(--o365-blue);
    text-decoration: none;
    padding-left: 1.2rem;
}

.admin-module-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--o365-blue);
    color: white;
    border-radius: 2px;
    margin-right: 0.75rem;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.admin-module-item:hover .admin-module-icon {
    background: var(--o365-blue-dark);
}

.admin-module-title {
    font-weight: 400;
    font-size: 0.95rem;
    flex: 1;
    color: var(--o365-text-primary);
}

.admin-module-item:hover .admin-module-title {
    font-weight: 600;
}

/* ========================================
   STATISTICS CARDS
   ======================================== */

.stat-card-o365 {
    background: white;
    border: 1px solid var(--o365-border);
    border-radius: 2px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
    border-left: 4px solid;
}

.stat-card-o365:hover {
    box-shadow: 0 3.2px 7.2px 0 rgba(0,0,0,.132), 0 0.6px 1.8px 0 rgba(0,0,0,.108);
    transform: translateY(-2px);
}

.stat-card-primary { border-left-color: var(--o365-blue); }
.stat-card-success { border-left-color: var(--o365-green); }
.stat-card-info { border-left-color: var(--o365-cyan); }
.stat-card-warning { border-left-color: var(--o365-yellow); }
.stat-card-secondary { border-left-color: var(--o365-text-secondary); }

.stat-card-o365 .card-title {
    color: var(--o365-text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

.stat-card-o365 .stat-value {
    color: var(--o365-text-primary);
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card-o365 .stat-label {
    color: var(--o365-text-secondary);
    font-size: 0.85rem;
}

.stat-card-o365 i.card-icon {
    font-size: 1rem;
    margin-right: 0.65rem;
}

/* ========================================
   CHART CARDS
   ======================================== */

.chart-card-o365 {
    background: white;
    border: 1px solid var(--o365-border);
    border-radius: 2px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.chart-card-o365 .card-header {
    background: var(--o365-bg-light);
    border-bottom: 1px solid var(--o365-border);
    padding: 1rem 1.25rem;
}

.chart-card-o365 .card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--o365-text-primary);
}

.chart-card-o365 .card-header i {
    color: var(--o365-blue);
    margin-right: 0.65rem;
}

.chart-card-o365 .card-body {
    padding: 1.25rem;
}

/* ========================================
   TOP PROJECTS LIST
   ======================================== */

.top-project-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--o365-bg-light);
}

.top-project-item:last-child {
    border-bottom: none;
}

.top-project-item h6 {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    color: var(--o365-text-primary);
}

.top-project-item .project-hours {
    font-weight: 600;
    color: var(--o365-blue);
    font-size: 1.1rem;
}

.top-project-item small {
    color: var(--o365-text-secondary);
}

.medal-gold { color: var(--o365-yellow) !important; margin-right: 0.5rem; }
.medal-silver { color: #c8c6c4 !important; margin-right: 0.5rem; }
.medal-bronze { color: #cd7f32 !important; margin-right: 0.5rem; }

/* ========================================
   NEWS ITEMS
   ======================================== */

.news-item-o365 {
    padding: 1.25rem 1.5rem;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.news-title-wrapper {
    flex: 1;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--o365-text-primary);
    margin: 0.5rem 0 0.25rem 0;
}

.news-badge-o365 {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-feature {
    background: var(--o365-green);
    color: white;
}

.badge-improvement {
    background: var(--o365-blue);
    color: white;
}

.badge-bugfix {
    background: var(--o365-yellow);
    color: var(--o365-text-primary);
}

.badge-security {
    background: var(--o365-red);
    color: white;
}

.badge-other {
    background: var(--o365-text-secondary);
    color: white;
}

.news-version {
    color: var(--o365-text-secondary);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.news-date {
    color: var(--o365-text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    margin-left: 1rem;
}

.news-content {
    color: var(--o365-text-primary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.news-content p {
    margin-bottom: 0.5rem;
}

.news-content ul {
    margin-left: 1.5rem;
}

.news-author {
    color: var(--o365-text-secondary);
    font-size: 0.85rem;
}

.news-author i {
    color: var(--o365-blue);
    margin-right: 0.35rem;
}

/* ========================================
   INFO CARDS
   ======================================== */

.info-card-o365 {
    background: var(--o365-blue-light);
    border: 1px solid #c7e0f4;
    border-left: 4px solid var(--o365-blue);
    border-radius: 2px;
    padding: 1rem 1.25rem;
    color: var(--o365-text-primary);
    margin-bottom: 2rem;
}

.info-card-o365 i {
    color: var(--o365-blue);
    margin-right: 0.5rem;
}

.info-card-o365 a {
    color: var(--o365-blue);
    font-weight: 600;
    text-decoration: none;
}

.info-card-o365 a:hover {
    text-decoration: underline;
}

/* ========================================
   WELCOME CARD
   ======================================== */

.welcome-card {
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 3rem;
}

.welcome-card h2 {
    color: var(--o365-text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.welcome-card .lead {
    color: var(--o365-text-secondary);
    font-size: 1.1rem;
}

.welcome-card a {
    color: var(--o365-blue);
    font-weight: 600;
    text-decoration: none;
}

.welcome-card a:hover {
    text-decoration: underline;
}

/* ========================================
   FORMS
   ======================================== */

.form-o365 .form-group {
    margin-bottom: 1.25rem;
}

.form-o365 label,
.form-label {
    color: var(--o365-text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-o365 .form-control,
.form-control {
    border: 1px solid var(--o365-text-secondary);
    border-radius: 2px;
    padding: 0.5rem 0.75rem;
    color: var(--o365-text-primary);
    background-color: white;
}

.form-o365 .form-control:focus,
.form-control:focus {
    border-color: var(--o365-blue);
    box-shadow: 0 0 0 1px var(--o365-blue);
    outline: none;
}

.form-select {
    border: 1px solid var(--o365-text-secondary);
    border-radius: 2px;
    padding: 0.5rem 0.75rem;
    color: var(--o365-text-primary);
    background-color: white;
    transition: all 0.2s ease;
}

.form-select:focus {
    border-color: var(--o365-blue);
    box-shadow: 0 0 0 1px var(--o365-blue);
    outline: none;
}

.form-select:hover {
    border-color: var(--o365-border-dark);
}

/* ========================================
   JQGRID TABLE STYLING
   ======================================== */

.ui-jqgrid {
    border: 1px solid var(--o365-border) !important;
    border-radius: 2px !important;
}

.ui-jqgrid .ui-jqgrid-view {
    font-size: 0.9rem;
}

.ui-jqgrid .ui-jqgrid-htable thead {
    background: var(--o365-bg-light) !important;
}

.ui-jqgrid .ui-jqgrid-htable th {
    background: var(--o365-bg-light) !important;
    border-color: var(--o365-border) !important;
    color: var(--o365-text-primary) !important;
    font-weight: 600 !important;
    padding: 0.75rem 0.5rem !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

.ui-jqgrid tr.jqgrow {
    border-color: var(--o365-bg-light) !important;
    background: white !important;
}

.ui-jqgrid tr.jqgrow:hover {
    background: var(--o365-bg-light) !important;
}

.ui-jqgrid tr.jqgrow td {
    border-color: var(--o365-bg-light) !important;
    padding: 0.65rem 0.5rem !important;
    color: var(--o365-text-primary);
}

.ui-jqgrid .ui-jqgrid-pager {
    background: var(--o365-bg-light) !important;
    border-color: var(--o365-border) !important;
}

/* ========================================
   WEEKLY TABLE (Admin)
   ======================================== */

.weekly-table-modern {
    background: white;
    border: 1px solid var(--o365-border);
    border-radius: 2px;
    overflow: hidden;
    font-size: 0.9rem;
}

.weekly-table-modern table {
    margin-bottom: 0;
}

.weekly-table-modern thead {
    background: var(--o365-blue);
    color: white;
}

.weekly-table-modern thead th {
    border: none;
    padding: 0.75rem 0.85rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.weekly-table-modern tbody tr {
    transition: background 0.1s ease;
    border-bottom: 1px solid var(--o365-bg-light);
}

.weekly-table-modern tbody tr:hover {
    background: var(--o365-bg-light);
}

.weekly-table-modern tbody td {
    padding: 0.65rem 0.85rem;
    vertical-align: middle;
    color: var(--o365-text-primary);
}

/* ========================================
   USER AVATARS
   ======================================== */

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 0.5rem;
    border: 2px solid var(--o365-border);
}

.dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    border: 2px solid var(--o365-border);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-success {
    color: var(--o365-green) !important;
}

.text-danger {
    color: var(--o365-red) !important;
}

.badge.bg-info {
    background-color: var(--o365-blue) !important;
}

.badge.bg-secondary {
    background-color: var(--o365-text-secondary) !important;
}

/* ========================================
   LOGIN PAGE
   ======================================== */

/* Login page background - subtle gradient */
body {
    background: #faf9f8;
}

/* Login icon animation */
.fa-user-circle {
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Login input focus enhancement */
.form-o365 input.form-control:focus {
    border-color: var(--o365-blue);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

/* 2FA code input styling */
input[name="2fa_code"] {
    font-weight: 600;
    color: var(--o365-blue);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .admin-header h2,
    .admin-account-header h2,
    .dashboard-header h2,
    .index-header h2 {
        font-size: 1.2rem;
    }
}

/* ========================================
   ADMIN_ANOMALY MODULE
   ======================================== */

.anomaly-stat-card {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1.6px 3.6px 0 rgba(0,0,0,.132), 0 0.3px 0.9px 0 rgba(0,0,0,.108);
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #0078d4;
}

.anomaly-stat-card.high-severity {
    border-left-color: #d13438;
}

.anomaly-stat-card.warning {
    border-left-color: #ffc83d;
}

.anomaly-stat-card.success {
    border-left-color: #107c10;
}

.stat-value {
    font-size: 36px;
    font-weight: 600;
    color: #323130;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #605e5c;
}

.filter-panel {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1.6px 3.6px 0 rgba(0,0,0,.132), 0 0.3px 0.9px 0 rgba(0,0,0,.108);
    padding: 20px;
    margin-bottom: 20px;
}

.severity-badge {
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.severity-critical {
    background: #d13438;
    color: white;
}

.severity-high {
    background: #ff8c00;
    color: white;
}

.severity-medium {
    background: #ffc83d;
    color: #323130;
}

.severity-low {
    background: #f3f2f1;
    color: #605e5c;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-new {
    background: #d13438;
    color: white;
}

.status-acknowledged {
    background: #ffc83d;
    color: #323130;
}

.status-resolved {
    background: #107c10;
    color: white;
}

.status-false_positive {
    background: #605e5c;
    color: white;
}

.anomaly-type-icon {
    margin-right: 5px;
}

#anomaly_detail_modal .modal-body {
    max-height: 600px;
    overflow-y: auto;
}

.metadata-table {
    width: 100%;
    margin-top: 15px;
}

.metadata-table th {
    text-align: left;
    padding: 8px;
    background: #f3f2f1;
    font-weight: 600;
}

.metadata-table td {
    padding: 8px;
    border-bottom: 1px solid #edebe9;
}

.action-buttons {
    margin-top: 15px;
}

.action-buttons .btn {
    margin-right: 10px;
}

#settings_panel, #rules_panel {
    display: none;
    margin-top: 20px;
}

.rule-config-item {
    background: #f3f2f1;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.rule-config-item h4 {
    margin-top: 0;
    color: #323130;
}

.threshold-input {
    margin: 5px 0;
}

.threshold-input label {
    display: inline-block;
    width: 200px;
    font-weight: 600;
}

.threshold-input input {
    width: 150px;
    padding: 5px;
    border: 1px solid #edebe9;
    border-radius: 2px;
}

/* ========================================
   ADMIN_SETTLEMENT MODULE
   ======================================== */

.blur {
    color: transparent;
    text-shadow: 0 0 8px #000;
}

/* ========================================
   ADMIN_OPCACHE MODULE
   ======================================== */

.opcache-metric {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.opcache-metric .metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.opcache-metric .metric-details {
    flex: 1;
}

.opcache-metric .metric-label {
    font-size: 0.875rem;
    color: var(--o365-text-secondary);
    margin-bottom: 0.25rem;
}

.opcache-metric .metric-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--o365-text-primary);
    line-height: 1.2;
}

.opcache-metric .metric-subtext {
    font-size: 0.75rem;
    color: var(--o365-text-secondary);
    margin-top: 0.25rem;
}
