/* ==========================================================================
   KHASMCITY UI KIT
   مكتبة كلاسات جاهزة (أزرار، بادجات، تنبيهات، كروت...) بألوان هوية الموقع.
   كل الكلاسات مبدوءة بـ kc- عشان متتعارضش مع أي كلاس موجود في style.css.
   استخدام: أضف <link rel="stylesheet" href="/static/css/ui-kit.css"> في أي صفحة.
   ========================================================================== */

:root {
    --kc-primary: #6366f1;
    --kc-primary-2: #8b5cf6;
    --kc-dark: #4f46e5;
    --kc-accent: #ec4899;
    --kc-green: #10b981;
    --kc-red: #ef4444;
    --kc-amber: #f59e0b;
    --kc-blue: #3b82f6;
    --kc-text: #1e2233;
    --kc-muted: #6b7280;
    --kc-border: #ececf3;
    --kc-surface: #ffffff;
    --kc-surface-2: #f3f4fb;
    --kc-radius: 14px;
    --kc-radius-sm: 8px;
    --kc-radius-lg: 22px;
    --kc-shadow: 0 8px 30px rgba(17, 24, 39, 0.07);
    --kc-gradient: linear-gradient(135deg, var(--kc-primary) 0%, var(--kc-primary-2) 100%);
}

/* ==========================================================================
   1) أزرار — .kc-btn
   ========================================================================== */

.kc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0.75rem 1.4rem;
    border-radius: var(--kc-radius-sm);
    background: var(--kc-gradient);
    color: #fff;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.kc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.32);
}

.kc-btn:active {
    transform: translateY(0);
}

.kc-btn:disabled,
.kc-btn.kc-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* أحجام */
.kc-btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}

.kc-btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.kc-btn-block {
    display: flex;
    width: 100%;
}

.kc-btn-icon {
    padding: 0.7rem;
    border-radius: 50%;
}

/* ألوان/أنماط بديلة */
.kc-btn-outline {
    background: transparent;
    color: var(--kc-primary);
    box-shadow: none;
    border: 2px solid var(--kc-primary);
}

.kc-btn-outline:hover {
    background: rgba(99, 102, 241, 0.08);
}

.kc-btn-ghost {
    background: rgba(99, 102, 241, 0.1);
    color: var(--kc-primary);
    box-shadow: none;
}

.kc-btn-ghost:hover {
    background: rgba(99, 102, 241, 0.18);
}

.kc-btn-success {
    background: var(--kc-green);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
}

.kc-btn-danger {
    background: var(--kc-red);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.28);
}

.kc-btn-warning {
    background: var(--kc-amber);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
}

.kc-btn-dark {
    background: var(--kc-text);
    box-shadow: 0 4px 14px rgba(30, 34, 51, 0.25);
}

/* زرار دائري لأيقونة بس */
.kc-btn-round {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
}

/* ==========================================================================
   2) بادجات / تاجات — .kc-badge
   ========================================================================== */

.kc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    background: rgba(99, 102, 241, 0.12);
    color: var(--kc-primary);
    white-space: nowrap;
}

.kc-badge-solid {
    background: var(--kc-gradient);
    color: #fff;
}

.kc-badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--kc-green);
}

.kc-badge-success.kc-badge-solid {
    background: var(--kc-green);
    color: #fff;
}

.kc-badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--kc-red);
}

.kc-badge-danger.kc-badge-solid {
    background: var(--kc-red);
    color: #fff;
}

.kc-badge-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #92620a;
}

.kc-badge-warning.kc-badge-solid {
    background: var(--kc-amber);
    color: #fff;
}

.kc-badge-muted {
    background: var(--kc-surface-2);
    color: var(--kc-muted);
}

.kc-badge-dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ==========================================================================
   3) تنبيهات — .kc-alert
   ========================================================================== */

.kc-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 1rem 1.2rem;
    border-radius: var(--kc-radius-sm);
    border: 1px solid transparent;
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.kc-alert-info {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
    color: #1d4ed8;
}

.kc-alert-success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: #047857;
}

.kc-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #92620a;
}

.kc-alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: #b91c1c;
}

.kc-alert-close {
    margin-inline-start: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: inherit;
    opacity: 0.6;
}

.kc-alert-close:hover {
    opacity: 1;
}

/* ==========================================================================
   4) كروت — .kc-card
   ========================================================================== */

.kc-card {
    background: var(--kc-surface);
    border: 1px solid var(--kc-border);
    border-radius: var(--kc-radius);
    box-shadow: var(--kc-shadow);
    padding: 1.4rem;
}

.kc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--kc-border);
}

.kc-card-title {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--kc-text);
    margin: 0;
}

.kc-card-subtitle {
    color: var(--kc-muted);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.kc-card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kc-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(99, 102, 241, 0.16);
}

/* ==========================================================================
   5) أفاتار / أيقونة دائرية — .kc-avatar
   ========================================================================== */

.kc-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--kc-gradient);
    color: #fff;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.kc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kc-avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.kc-avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.3rem;
}

/* ==========================================================================
   6) تولتيب بسيط — .kc-tooltip
   ========================================================================== */

.kc-tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dashed var(--kc-muted);
}

.kc-tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 50%;
    transform: translateX(50%) translateY(4px);
    background: var(--kc-text);
    color: #fff;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    font-size: 0.78rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
}

.kc-tooltip:hover::after {
    opacity: 1;
    transform: translateX(50%) translateY(0);
}

/* ==========================================================================
   7) سبينر / تحميل — .kc-spinner
   ========================================================================== */

.kc-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--kc-primary);
    border-radius: 50%;
    animation: kc-spin 0.7s linear infinite;
    display: inline-block;
}

.kc-spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.kc-spinner-lg {
    width: 34px;
    height: 34px;
    border-width: 4px;
}

@keyframes kc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   8) شريط تقدّم — .kc-progress
   ========================================================================== */

.kc-progress {
    width: 100%;
    height: 8px;
    background: var(--kc-surface-2);
    border-radius: 999px;
    overflow: hidden;
}

.kc-progress-bar {
    height: 100%;
    background: var(--kc-gradient);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ==========================================================================
   9) سويتش تبديل — .kc-switch
   ========================================================================== */

.kc-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.kc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.kc-switch-track {
    position: absolute;
    inset: 0;
    background: var(--kc-border);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.kc-switch-track::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.kc-switch input:checked + .kc-switch-track {
    background: var(--kc-primary);
}

.kc-switch input:checked + .kc-switch-track::before {
    transform: translateX(-20px);
}

/* ==========================================================================
   10) فاصل — .kc-divider
   ========================================================================== */

.kc-divider {
    border: none;
    border-top: 1px solid var(--kc-border);
    margin: 1.2rem 0;
}

.kc-divider-text {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--kc-muted);
    font-size: 0.8rem;
    margin: 1.2rem 0;
}

.kc-divider-text::before,
.kc-divider-text::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--kc-border);
}

/* ==========================================================================
   11) كلاسات مساعدة عامة — utilities
   ========================================================================== */

.kc-text-muted {
    color: var(--kc-muted);
}

.kc-text-primary {
    color: var(--kc-primary);
}

.kc-text-success {
    color: var(--kc-green);
}

.kc-text-danger {
    color: var(--kc-red);
}

.kc-text-center {
    text-align: center;
}

.kc-text-bold {
    font-weight: 700;
}

.kc-flex {
    display: flex;
    align-items: center;
}

.kc-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kc-flex-wrap {
    flex-wrap: wrap;
}

.kc-gap-sm {
    gap: 0.5rem;
}

.kc-gap-md {
    gap: 1rem;
}

.kc-gap-lg {
    gap: 1.6rem;
}

.kc-rounded {
    border-radius: var(--kc-radius);
}

.kc-shadow {
    box-shadow: var(--kc-shadow);
}

.kc-mt-sm {
    margin-top: 0.6rem;
}

.kc-mt-md {
    margin-top: 1.2rem;
}

.kc-mt-lg {
    margin-top: 2rem;
}

.kc-mb-sm {
    margin-bottom: 0.6rem;
}

.kc-mb-md {
    margin-bottom: 1.2rem;
}

.kc-mb-lg {
    margin-bottom: 2rem;
}