:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --card-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --border-radius: 0.5rem;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--light-bg);
    color: var(--dark-text);
    margin: 0;
    padding: 20px;
    direction: rtl;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.d-flex {
    display: flex;
}

.gap-2 {
    gap: 0.5rem;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

/* Components */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
    color: white;
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
}

.btn-success {
    background-color: var(--success-color);
}

.btn-success:hover {
    background-color: #157347;
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-warning {
    background-color: var(--warning-color);
    color: #000;
}

input,
select {
    display: block;
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    box-sizing: border-box;
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th,
td {
    padding: 0.75rem;
    vertical-align: top;
    border-bottom: 1px solid #dee2e6;
    text-align: right;
}

th {
    background-color: rgba(0, 0, 0, 0.05);
}

.badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    border-radius: 0.25rem;
    color: white;
}

.bg-success {
    background-color: var(--success-color);
}

.bg-secondary {
    background-color: var(--secondary-color);
}

.bg-primary {
    background-color: var(--primary-color);
}

.bg-warning {
    background-color: var(--warning-color);
    color: #000;
}

/* Custom */
.online-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.online {
    background-color: var(--success-color);
}

.offline {
    background-color: var(--secondary-color);
}

/* --- Premium UI Classes (Glassmorphism & Gradients) --- */

.bg-gradient-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #20c997 0%, #198754 100%);
    color: white;
    border: none;
}

.bg-gradient-success:hover {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(25, 135, 84, 0.3) !important;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #0dcaf0 0%, #0bacbe 100%);
    color: white;
    border: none;
}

.bg-gradient-info:hover {
    background: linear-gradient(135deg, #0bacbe 0%, #087990 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(13, 202, 240, 0.3) !important;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #000;
    border: none;
}

.bg-gradient-warning:hover {
    background: linear-gradient(135deg, #ffb300 0%, #e6a200 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 193, 7, 0.3) !important;
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5c636a 100%);
    color: white;
    border: none;
}

.bg-gradient-secondary:hover {
    background: linear-gradient(135deg, #5c636a 0%, #4c5258 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(108, 117, 125, 0.3) !important;
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    border-radius: 24px;
}

.soft-shadow {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

.premium-btn {
    transition: all 0.3s ease;
}

.premium-btn:active {
    transform: translateY(1px) !important;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1) !important;
}

/* specific app background */
.app-bg {
    background: linear-gradient(120deg, #f0f4f8 0%, #e0eaf5 100%);
}

/* --- Landing Page Classes --- */
.landing-body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.landing-container {
    max-width: 1200px;
    width: 100%;
    padding: 20px;
}

.main-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 40px;
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    justify-content: center;
}

.card-link {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    position: relative;
    overflow: hidden;
}

.card-link:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    transition: transform 0.5s ease;
}

.card-link:hover .card-icon {
    transform: scale(1.1);
}

.card-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #34495e;
    margin-bottom: 10px;
}

.card-desc {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.input-group {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    width: 100%;
}

.input-group input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
}

.input-group button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.border-top-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* --- Seamless Gapless News Ticker --- */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background-color: var(--primary-color);
    color: white;
    padding: 15px 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    direction: ltr;
    /* Lock physical movement math to LTR */
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.ticker-track {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    width: max-content;
    align-items: center;
    animation: seamless-ticker 80s linear infinite;
}

.ticker-track:hover {
    animation-play-state: paused;
}

@keyframes seamless-ticker {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0%);
    }
}

.ticker-item {
    direction: rtl;
    /* Restore Arabic reading flow */
    white-space: nowrap;
    display: inline-block;
    font-size: 2.2rem;
    font-weight: 900;
}