:root {
    --primary-color: #FF5C8A;
    --primary-light: #FF8FAB;
    --primary-dark: #FF1F64;
    --primary-gradient: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    --background-color: #F8F9FD;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --transition-speed: 0.3s;
    --mobile-header-height: 60px;
    --mobile-padding: 1rem;
}

body {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    background-color: var(--background-color);
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

button, input, select, textarea {
    font-family: 'IBM Plex Sans Arabic';
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Mobile overlay for sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed) ease;
    position: relative;
    z-index: 40;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    min-height: var(--header-height);
    box-sizing: border-box;
}

.sidebar-logo {
    height: 40px;
    width: auto;
    transition: all var(--transition-speed) ease;
}

.sidebar.collapsed .sidebar-logo {
    width: 40px;
    height: 40px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--background-color);
    color: var(--primary-color);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.menu-section {
    margin-bottom: 2rem;
}

.menu-label {
    color: #666;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding: 0 0.75rem;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #4a4a4a;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.menu-item:hover {
    background: var(--background-color);
    color: var(--primary-color);
    text-decoration: none;
}

.menu-item.is-active {
    background: var(--primary-gradient);
    color: white;
}

.menu-item .icon {
    margin-left: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.menu-text {
    flex: 1;
    transition: opacity var(--transition-speed) ease;
    white-space: nowrap;
}

.sidebar.collapsed .menu-text {
    opacity: 0;
    width: 0;
    display: none;
}

.tag {
    transition: all var(--transition-speed) ease;
    flex-shrink: 0;
}

.sidebar.collapsed .tag {
    display: none;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

.top-bar {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.search-bar {
    position: relative;
    width: 300px;
    max-width: 100%;
}

.search-bar .icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

.search-bar .input {
    padding-right: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--background-color);
    width: 100%;
}

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

.content-wrapper {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Mobile hamburger menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-right: 1rem;
}

.mobile-menu-toggle:hover {
    background: var(--background-color);
    color: var(--primary-color);
}

/* Enhanced Responsive Design */
@media screen and (max-width: 1200px) {
    .search-bar {
        width: 250px;
    }
    
    .content-wrapper {
        padding: 1.5rem;
    }
}

@media screen and (max-width: 1024px) {
    .sidebar {
        position: fixed;
        z-index: 1000;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform var(--transition-speed) ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
        width: 100%;
    }
    
    .search-bar {
        width: 200px;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --header-height: var(--mobile-header-height);
    }
    
    .top-bar {
        padding: 0 var(--mobile-padding);
        height: var(--mobile-header-height);
    }
    
    .search-bar {
        width: 150px;
        order: 2;
    }
    
    .search-bar .input {
        font-size: 14px;
        padding: 0.5rem 2rem 0.5rem 0.75rem;
    }
    
    .top-bar-actions {
        gap: 0.5rem;
        order: 3;
    }
    
    .mobile-menu-toggle {
        order: 1;
        margin-right: 0.5rem;
    }
    
    .content-wrapper {
        padding: var(--mobile-padding);
    }
    
    .sidebar-header {
        padding: 1rem;
        min-height: var(--mobile-header-height);
    }
    
    .sidebar-content {
        padding: 1rem 0.75rem;
    }
    
    .menu-item {
        padding: 0.875rem 1rem;
        margin-bottom: 0.25rem;
    }
    
    .menu-item .icon {
        margin-left: 0.75rem;
    }
    
    .sidebar-footer {
        padding: 1rem;
    }
}

@media screen and (max-width: 480px) {
    .top-bar {
        padding: 0 0.75rem;
        flex-wrap: nowrap;
    }
    
    .search-bar {
        width: 120px;
        min-width: 120px;
    }
    
    .search-bar .input {
        font-size: 13px;
        padding: 0.4rem 1.75rem 0.4rem 0.5rem;
    }
    
    .search-bar .icon {
        right: 0.5rem;
        font-size: 0.875rem;
    }
    
    .top-bar-actions {
        gap: 0.25rem;
    }
    
    .top-bar-actions .button {
        padding: 0.5rem;
        min-width: auto;
    }
    
    .content-wrapper {
        padding: 0.75rem;
    }
    
    .sidebar {
        width: 280px;
    }
    
    .sidebar-header {
        padding: 0.75rem;
    }
    
    .sidebar-logo {
        height: 32px;
    }
    
    .menu-item {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .menu-label {
        font-size: 0.75rem;
        padding: 0 0.875rem;
    }
}

/* Notification styles remain the same */
.notification-count {
    position: absolute;
    top: -8px;
    left: -8px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notification-header {
    padding: 1rem;
    border-bottom: 1px solid #f5f5f5;
    background: #fafafa;
    font-weight: 600;
    color: #333;
}

.notification-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: background-color 0.2s ease;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: #f9f9f9;
}

.notification-item.unread {
    background: #fff8f0;
}

.notification-item.unread:hover {
    background: #fff5e6;
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.notification-icon.type-user {
    background: #3273dc;
}

.notification-icon.type-post {
    background: #23d160;
}

.notification-icon.type-comment {
    background: #ffdd57;
    color: #333;
}

.notification-icon.type-report {
    background: #ff3860;
}

.notification-icon.type-default {
    background: #666;
}

.notification-content {
    flex: 1;
}

.notification-message {
    margin-bottom: 0.25rem;
    line-height: 1.4;
    color: #333;
    font-size: 0.9rem;
}

.notification-time {
    font-size: 0.8rem;
    color: #999;
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.notification-action {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-action:hover {
    transform: translateY(-1px);
}

.notification-action.danger {
    background: #ff3860;
    color: white;
}

.notification-action.danger:hover {
    background: #ff1f4b;
}

.dropdown-menu {
    min-width: 320px;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: none;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: auto;
    left: 0;
    z-index: 20;
    display: none;
    min-width: 12rem;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 0.875rem;
    background-color: white;
    background-clip: padding-box;
    border-radius: 6px;
    box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);
}

.dropdown.is-active .dropdown-menu {
    display: block;
}

figure.is-32x32,
.image.is-32x32 {
    height: 32px;
    width: 32px;
}

th {
    font-weight: 600 !important;
}

.icon {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    height: 1.5rem;
    width: 1.5rem;
}

@media screen and (max-width: 480px) {
    .dropdown-menu {
        min-width: 280px;
        max-width: calc(100vw - 2rem);
        right: 1rem;
        left: 1rem;
        width: auto;
        position: fixed;
        top: auto;
        bottom: 1rem;
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    .notification-list {
        max-height: 250px;
    }

    .notification-item {
        padding: 0.875rem;
        font-size: 0.875rem;
    }
}

.notification-username {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.notification-username a {
    color: inherit;
    text-decoration: none;
}

.notification-username a:hover {
    text-decoration: underline;
}

/* Notification Preview Styles */
.notification-preview {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    margin: 8px 0;
}

.notification-icon {
    font-size: 24px;
    margin-right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    border-radius: 50%;
    color: white;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.2;
}

.notification-body {
    font-size: 13px;
    color: #666;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Notification Modal Enhancements */
#notificationModal .modal-card {
    max-width: 600px;
    width: 90%;
}

#notificationModal .field {
    margin-bottom: 1.5rem;
}

#notificationModal .textarea {
    resize: vertical;
    min-height: 80px;
}

#notificationModal .help {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    z-index: 10000;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

.notification-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.notification-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.notification-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.notification-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 220px;
    padding: 1rem;
}
#user-menu{
    right: auto;
    left: 0;
}

.notification-icon {
    font-size: 1.2rem;
    margin-right: 0.75rem;
}

.notification-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    margin-left: 0.5rem;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
span.icon + span {
    padding: 0 10px 0 0;
}

/* FCM Tokens Modal Styles */
.fcm-tokens-content {
    max-height: 70vh;
    overflow-y: auto;
}

.fcm-token-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fcm-token-cell code {
    flex: 1;
    font-size: 12px;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
}

.tab-content {
    margin-top: 20px;
}

.tab-pane {
    display: none;
}

.tab-pane.is-active {
    display: block;
}

.table-container {
    /* max-height: 400px; */
    overflow-y: auto;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-card {
    max-height: 90vh;
}

.modal-card-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Summary cards styling */
.box {
    transition: transform 0.2s ease;
}

.box:hover {
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .modal-card {
        width: 95% !important;
        margin: 0 auto;
    }
    
    .columns.is-multiline .column {
        flex-basis: 50%;
    }
    
    .table-container {
        font-size: 14px;
    }
    
    .fcm-token-cell {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* In-App Messaging Styles */
.select.is-fullwidth {
    width: 100%;
}

.select.is-fullwidth select {
    width: 100%;
}

#articlePreview {
    border-left: 4px solid #3273dc;
    background: #f8f9fa;
}

#articleThumbnailImg {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e5e5e5;
}

#articlePreviewTitle {
    margin-bottom: 8px;
    color: #363636;
    font-weight: 600;
}

#articlePreviewExcerpt {
    color: #666;
    line-height: 1.4;
    margin: 0;
}

/* Enhanced form styling */
.field .help {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.field .label {
    font-weight: 600;
    color: #363636;
}

/* Button spacing */
.buttons .button {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Modal enhancements */
.modal-card {
    max-height: 95vh;
    overflow-y: auto;
}

.modal-card-body {
    max-height: 80vh;
    overflow-y: auto;
}

/* Article dropdown styling */
#inAppArticleSelect {
    font-size: 0.9rem;
}

#inAppArticleSelect option {
    padding: 8px;
    font-size: 0.9rem;
}

/* Responsive improvements */
@media screen and (max-width: 768px) {
    .modal-card {
        width: 98% !important;
        margin: 1%;
    }
    
    .columns.is-multiline .column {
        flex-basis: 50%;
    }
    
    #articlePreview .columns {
        flex-direction: column;
    }
    
    #articlePreview .column.is-2 {
        flex-basis: auto;
        margin-bottom: 10px;
    }
    
    #articlePreview .column.is-10 {
        flex-basis: auto;
    }
}