/* ============================================================
   Red Sea Systems - Global Styles
   Arabic RTL Dashboard Platform
   ============================================================ */

/* --- Base Reset & Fonts --- */
* {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    box-sizing: border-box;
}

body {
    background: #f4f6f9;
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
    font-size: 14px;
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.sidebar .logo-area {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
}

.sidebar .logo-area h5 {
    color: #fff;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.sidebar .logo-area small {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
}

.sidebar .nav-section {
    padding: 8px 20px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 25px;
    color: rgba(255,255,255,0.7);
    font-size: 13.5px;
    transition: all 0.2s ease;
    border-radius: 0;
    position: relative;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
    font-weight: 500;
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
}

.sidebar .nav-link i {
    width: 22px;
    text-align: center;
    margin-left: 10px;
    font-size: 14px;
}

.sidebar .nav-link .badge {
    margin-right: auto;
    margin-left: 0;
    font-size: 10px;
}

.sidebar hr {
    border-color: rgba(255,255,255,0.1);
    margin: 12px 25px;
}

/* --- Sidebar Color Themes --- */
/* Admin - Dark */
.sidebar-admin {
    background: linear-gradient(180deg, #1a1c2e 0%, #2d2f45 100%);
}
.sidebar-admin .nav-link.active::before {
    background: #6c63ff;
}

/* Marketing - Blue */
.sidebar-marketing {
    background: linear-gradient(180deg, #0d2137 0%, #1a3a5c 100%);
}
.sidebar-marketing .nav-link.active::before {
    background: #2196F3;
}

/* HR - Green */
.sidebar-hr {
    background: linear-gradient(180deg, #0d2b1a 0%, #1a4a30 100%);
}
.sidebar-hr .nav-link.active::before {
    background: #4CAF50;
}

/* Content - Purple */
.sidebar-content {
    background: linear-gradient(180deg, #2a1535 0%, #3d2455 100%);
}
.sidebar-content .nav-link.active::before {
    background: #9C27B0;
}

/* --- Main Content --- */
.main-content {
    margin-right: 260px;
    margin-left: 0;
    min-height: 100vh;
    padding: 0;
}

/* --- Topbar --- */
.topbar {
    background: #fff;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar .page-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #1a1c2e;
}

.topbar .topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #666;
}

.topbar .user-info .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
}

/* Notification Bell */
.notification-bell {
    position: relative;
    padding: 8px;
    cursor: pointer;
    color: #666;
    font-size: 18px;
}

.notification-bell .badge-count {
    position: absolute;
    top: 2px;
    left: 2px;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* --- Content Area --- */
.content-area {
    padding: 25px 30px;
}

/* --- Dashboard Cards --- */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 15px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1c2e;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #888;
}

/* Stat card icon colors */
.stat-icon-primary { background: rgba(108,99,255,0.1); color: #6c63ff; }
.stat-icon-success { background: rgba(76,175,80,0.1); color: #4CAF50; }
.stat-icon-info    { background: rgba(33,150,243,0.1); color: #2196F3; }
.stat-icon-warning { background: rgba(255,152,0,0.1); color: #FF9800; }
.stat-icon-danger  { background: rgba(244,67,54,0.1); color: #f44336; }
.stat-icon-purple  { background: rgba(156,39,176,0.1); color: #9C27B0; }

/* --- Data Tables --- */
.data-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.data-card .card-header {
    padding: 18px 22px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
}

.data-card .card-header h6 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1c2e;
}

.data-card .card-body {
    padding: 22px;
}

.table {
    font-size: 13.5px;
}

.table th {
    font-weight: 600;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #f0f0f0;
    padding: 12px 15px;
    white-space: nowrap;
}

.table td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f8f8f8;
}

.table tbody tr:hover {
    background: #f8f9ff;
}

/* --- Status Badges --- */
.badge-status {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 500;
}

.badge-pending   { background: #fff3cd; color: #856404; }
.badge-running   { background: #cce5ff; color: #004085; }
.badge-completed { background: #d4edda; color: #155724; }
.badge-failed    { background: #f8d7da; color: #721c24; }
.badge-cancelled { background: #e2e3e5; color: #383d41; }
.badge-active    { background: #d4edda; color: #155724; }
.badge-inactive  { background: #f8d7da; color: #721c24; }

/* Sentiment badges */
.badge-positive { background: #d4edda; color: #155724; }
.badge-negative { background: #f8d7da; color: #721c24; }
.badge-neutral  { background: #e2e3e5; color: #383d41; }
.badge-mixed    { background: #fff3cd; color: #856404; }

/* --- Buttons --- */
.btn {
    font-size: 13.5px;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary-custom {
    background: #6c63ff;
    border-color: #6c63ff;
    color: #fff;
}

.btn-primary-custom:hover {
    background: #5a52d5;
    border-color: #5a52d5;
    color: #fff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12.5px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* --- Forms --- */
.form-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    padding: 25px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.form-control,
.form-select {
    font-size: 13.5px;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: border-color 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108,99,255,0.1);
}

.form-text {
    font-size: 12px;
    color: #999;
}

/* --- Alerts --- */
.alert {
    border-radius: 10px;
    font-size: 13.5px;
    border: none;
    padding: 14px 18px;
}

/* --- Login Page --- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1c2e 0%, #2d2f45 50%, #3a1c50 100%);
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card .login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-card .login-logo h3 {
    color: #1a1c2e;
    margin-bottom: 5px;
    font-weight: 700;
}

.login-card .login-logo p {
    color: #888;
    font-size: 13px;
    margin: 0;
}

/* --- Empty States --- */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 14px;
}

/* --- Pagination --- */
.pagination .page-link {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px !important;
    margin: 0 2px;
    color: #6c63ff;
}

.pagination .page-item.active .page-link {
    background: #6c63ff;
    border-color: #6c63ff;
}

/* --- Brand Selector (Topbar) --- */
.brand-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-selector select {
    font-size: 12.5px;
    padding: 5px 30px 5px 10px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    cursor: pointer;
    min-width: 160px;
}

/* --- Sidebar Close Button (mobile) --- */
.sidebar-close {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.sidebar-close:hover {
    background: rgba(255,255,255,0.25);
}

/* --- Sidebar Overlay (mobile) --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-close {
        display: flex;
    }
    .main-content {
        margin-right: 0;
    }
}

/* --- Animations --- */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Utility --- */
.text-muted-sm {
    font-size: 12px;
    color: #999;
}

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.masked-key {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    font-size: 13px;
    color: #666;
}
