/* Spencer Agents Portal - Custom Styles */

:root {
    --spencer-blue: #003366;
    --spencer-blue-light: #004d99;
    --spencer-gray: #6c757d;
    --sidebar-width: 250px;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--spencer-blue);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.6rem 1.2rem;
    border-radius: 0;
    transition: background-color 0.15s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background-color: var(--spencer-blue-light);
}

.sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 0.5rem;
}

.sidebar-brand {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-brand-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-logo {
    height: 40px;
    width: auto;
    margin-bottom: 0.4rem;
}

.sidebar-brand-text {
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-section-header {
    padding: 0.8rem 1.2rem 0.3rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background-color: #f5f6fa;
}

.top-bar {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1.5rem;
}

.page-content {
    padding: 1.5rem;
}

/* Login page */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--spencer-blue) 0%, var(--spencer-blue-light) 100%);
}

.login-card {
    max-width: 420px;
    width: 100%;
}

/* Data grid */
.data-grid table {
    font-size: 0.875rem;
}

.data-grid th,
.data-grid td {
    padding: 0.55rem 0.75rem;
}

.data-grid th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    background-color: #f8f9fa;
}

.data-grid th:hover {
    background-color: #e9ecef;
}

.data-grid .sort-icon {
    margin-left: 0.3rem;
    opacity: 0.4;
}

.data-grid th.sorted .sort-icon {
    opacity: 1;
}

.data-grid .filter-row input {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
}

.data-grid .expand-btn {
    cursor: pointer;
    color: var(--spencer-blue);
}

.data-grid .detail-row {
    background-color: #f8f9fa;
}

/* Pagination */
.pagination .page-link {
    color: var(--spencer-blue);
}

.pagination .page-item.active .page-link {
    background-color: var(--spencer-blue);
    border-color: var(--spencer-blue);
    color: #fff;
}

/* Cards */
.stat-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--spencer-blue);
}

/* User dropdown */
.user-dropdown .btn-link {
    color: var(--spencer-gray);
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

.user-dropdown .btn-link:hover {
    color: var(--spencer-blue);
}

.user-dropdown .dropdown-menu {
    font-size: 0.875rem;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 1px solid #dee2e6;
}

.user-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
}

.user-dropdown .dropdown-item:hover {
    background-color: #f0f4f8;
}

.user-dropdown .dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--spencer-gray);
}

/* Usage Dashboard */
.dashboard-chart-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.dashboard-chart-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
}

/* Bulletin */
.bulletin-card {
    border: none;
    border-left: 4px solid var(--spencer-blue);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    background-color: #f8fafd;
}

.bulletin-body {
    line-height: 1.6;
}

.bulletin-body h2, .bulletin-body h3 {
    color: var(--spencer-blue);
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.bulletin-body a {
    color: var(--spencer-blue-light);
}

.bulletin-body ul, .bulletin-body ol {
    margin-bottom: 0.5rem;
}

/* WYSIWYG Editor */
.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0.4rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 0.375rem 0.375rem 0 0;
}

.wysiwyg-toolbar button {
    background: none;
    border: 1px solid transparent;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    color: #495057;
    font-size: 0.85rem;
}

.wysiwyg-toolbar button:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.wysiwyg-toolbar .separator {
    width: 1px;
    background-color: #dee2e6;
    margin: 0.15rem 0.25rem;
}

.wysiwyg-editor {
    min-height: 200px;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0 0 0.375rem 0.375rem;
    outline: none;
    font-family: inherit;
    line-height: 1.6;
}

.wysiwyg-editor:focus {
    border-color: var(--spencer-blue-light);
    box-shadow: 0 0 0 0.2rem rgba(0, 77, 153, 0.15);
}

/* Messages */
.message-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.message-row:hover {
    background-color: #f0f4f8;
}

.message-row.unread {
    font-weight: 600;
    border-left: 3px solid var(--spencer-blue);
}

.message-row.unread td:first-child {
    padding-left: calc(0.75rem - 3px);
}

.message-detail-body {
    white-space: pre-wrap;
    line-height: 1.6;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
}

/* Responsive */
/* Toast Notifications */
.app-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    min-width: 300px;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
}

/* Confirm Dialog */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-box {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    min-width: 350px;
    max-width: 450px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.confirm-box-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.confirm-box-message {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}
