@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Outfit:wght@400;600;700&display=swap');

:root {
    --primary: #e8563f;
    /* Hwzn Coral */
    --primary-light: #ff765f;
    --primary-dark: #cc432f;
    --secondary: #373a40;
    /* Hwzn Charcoal */
    --accent: #ff9f1c;
    --danger: #ef4444;
    --success: #10b981;
    --text: #334155;
    --text-light: #64748b;
    --white: #ffffff;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    background-image: radial-gradient(at 0% 0%, rgba(232, 86, 63, 0.03) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(55, 58, 64, 0.03) 0, transparent 50%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    height: 60px;
    width: auto;
    margin-bottom: 0.5rem;
}

header h1 {
    color: var(--secondary);
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: 1.25rem;
    box-shadow: var(--shadow);
    text-align: right;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0.7;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(232, 86, 63, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.title-group h1 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 0.2rem;
    font-weight: 800;
}

.title-group p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.stat-card h3 {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--secondary);
    font-family: 'Outfit', sans-serif;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}

.badge.running {
    background: #ecfdf5;
    color: #059669;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.1);
}

.card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2.5rem;
    border: 1px solid var(--border);
}

.card h2 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card h2::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 24px;
    background: var(--primary);
    border-radius: 4px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-family: inherit;
    transition: all 0.2s;
    background: #f8fafc;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(232, 86, 63, 0.1);
}

.button-group {
    display: flex;
    gap: 1.25rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background: var(--primary);
    color: white;
}

.btn.primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(232, 86, 63, 0.25);
    transform: translateY(-2px);
}

.btn.danger {
    background: var(--danger);
    color: white;
}

.btn.danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
}

.btn.secondary {
    background: var(--secondary);
    color: white;
}

.btn.secondary:hover {
    background: #27292e;
    box-shadow: 0 4px 12px rgba(55, 58, 64, 0.2);
    transform: translateY(-2px);
}

.btn.success {
    background: var(--success);
    color: white;
}

.btn.success:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
}

.table-wrapper {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 1.5rem 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 1.25rem 1rem;
    border-bottom: 2px solid var(--border);
    text-align: right;
}

td {
    padding: 1.25rem 1rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    text-align: right;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: #f8fafc;
    cursor: pointer;
}

.hint {
    padding: 0.75rem 1.25rem;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 8px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: var(--white);
    margin: 3rem auto;
    padding: 0;
    border-radius: 1.5rem;
    width: 90%;
    max-width: 850px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: var(--primary);
    color: white;
    padding: 2rem;
}

.modal-body {
    padding: 2.5rem;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    left: 1.5rem;
    top: 1.5rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
    z-index: 10;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.detail-value {
    color: var(--secondary);
    font-weight: 500;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.8rem;
}

.social-tag {
    padding: 0.4rem 0.75rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text);
    transition: all 0.2s;
}

.social-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Social Icons Styling */
.social-icons-cell {
    display: flex;
    gap: 0.85rem;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
}

.social-icons-cell a {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: var(--text-light);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border);
    text-decoration: none !important;
}

.social-icons-cell a:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.social-icons-cell a i {
    font-size: 1.1rem;
}

/* Brand Colors & Icons - Global */
a[title="الموقع الإلكتروني"] i {
    color: #10b981;
}

a[title="الموقع الإلكتروني"]:hover {
    background: #10b981 !important;
    color: white !important;
    border-color: #10b981 !important;
}

a[title="الموقع الإلكتروني"]:hover i {
    color: white !important;
}

a[title="انستقرام"] i {
    color: #e4405f;
}

a[title="انستقرام"]:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
    color: white !important;
    border-color: transparent !important;
}

a[title="انستقرام"]:hover i {
    color: white !important;
}

a[title="سناب شات"] i {
    color: #f7d000;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
}

a[title="سناب شات"]:hover {
    background: #fffc00 !important;
    color: #000 !important;
    border-color: #e6e600 !important;
}

a[title="سناب شات"]:hover i {
    color: #000 !important;
}

a[title="تويتر (X)"] i {
    color: #000000;
}

a[title="تويتر (X)"]:hover {
    background: #000000 !important;
    color: white !important;
    border-color: #000 !important;
}

a[title="تويتر (X)"]:hover i {
    color: white !important;
}

a[title="تيك توك"] i {
    color: #000000;
}

a[title="تيك توك"]:hover {
    background: #000000 !important;
    color: white !important;
    border-color: #000 !important;
}

a[title="تيك توك"]:hover i {
    color: white !important;
}

a[title="واتساب"] i {
    color: #25d366;
}

a[title="واتساب"]:hover {
    background: #25d366 !important;
    color: white !important;
    border-color: #25d366 !important;
}

a[title="واتساب"]:hover i {
    color: white !important;
}

a[title="فيسبوك"] i {
    color: #1877f2;
}

a[title="فيسبوك"]:hover {
    background: #1877f2 !important;
    color: white !important;
    border-color: #1877f2 !important;
}

a[title="فيسبوك"]:hover i {
    color: white !important;
}

a[title="يوتيوب"] i {
    color: #ff0000;
}

a[title="يوتيوب"]:hover {
    background: #ff0000 !important;
    color: white !important;
    border-color: #ff0000 !important;
}

a[title="يوتيوب"]:hover i {
    color: white !important;
}

a[title="لينكد إن"] i {
    color: #0a66c2;
}

a[title="لينكد إن"]:hover {
    background: #0a66c2 !important;
    color: white !important;
    border-color: #0a66c2 !important;
}

a[title="لينكد إن"]:hover i {
    color: white !important;
}

/* Modal Social Tags */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.8rem;
}

.social-tag {
    padding: 0.6rem 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text);
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s;
    font-weight: 600;
}

.social-tag i {
    font-size: 1.25rem;
}

.social-tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    background: white;
}

/* Modal Tag Brand Hovers */
.social-tag[title="انستقرام"]:hover {
    border-color: #e4405f;
    color: #e4405f;
}

.social-tag[title="تويتر (X)"]:hover {
    border-color: #000;
    color: #000;
}

.social-tag[title="سناب شات"]:hover {
    border-color: #f7d000;
    color: #f7d000;
}

.social-tag[title="واتساب"]:hover {
    border-color: #25d366;
    color: #25d366;
}

.social-tag[title="تيك توك"]:hover {
    border-color: #000;
    color: #000;
}

.social-tag[title="فيسبوك"]:hover {
    border-color: #1877f2;
    color: #1877f2;
}

.social-tag[title="يوتيوب"]:hover {
    border-color: #ff0000;
    color: #ff0000;
}

.social-tag[title="لينكد إن"]:hover {
    border-color: #0a66c2;
    color: #0a66c2;
}

/* Fallback & Generic Social Icons */
a[title="رابط"] i {
    color: var(--text-light);
}

a[title="رابط"]:hover {
    background: var(--secondary) !important;
    color: white !important;
    border-color: var(--secondary) !important;
}

/* Status Badge Pulse */
.badge.running::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    margin-left: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Filter Bar Reset Button Polish */
#reset-filters {
    height: 42px;
    padding: 0 1.5rem;
}

#reset-filters:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
}

/* Filter & Pagination Styles */
.filter-bar {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 1.25rem;
    border: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.main-filters {
    flex: 1;
    min-width: 300px;
}

.secondary-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
}

.filter-group select {
    padding: 0.7rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: white;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(232, 86, 63, 0.1);
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-box input {
    width: 100%;
    padding: 0.85rem 2.75rem 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(232, 86, 63, 0.1);
}

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.pagination-info {
    color: var(--text-light);
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.pagination-controls span {
    font-weight: 600;
    color: var(--secondary);
    min-width: 100px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.btn.small {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #cbd5e1;
    color: #64748b;
    box-shadow: none;
    transform: none !important;
}