/* ============================================
   Custom Stylesheet
   تنسيقات مخصصة
   مؤسسة محمود الحفناوى للتنمية الخيرية
   ============================================ */

/* ============================================
   Cursor
   ============================================ */

.cursor-pointer { cursor: pointer; }
.cursor-help { cursor: help; }
.cursor-not-allowed { cursor: not-allowed; }

/* ============================================
   Hover Effects
   ============================================ */

.hover-lift {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.hover-shadow:hover {
    box-shadow: var(--shadow-md);
}

.hover-bg:hover {
    background-color: var(--gray-50);
}

/* ============================================
   Text Utilities
   ============================================ */

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-underline { text-decoration: underline; }
.text-linethrough { text-decoration: line-through; }
.text-uppercase { text-transform: uppercase; }
.text-capitalize { text-transform: capitalize; }

.text-break {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ============================================
   Avatars
   ============================================ */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-lg {
    width: 64px;
    height: 64px;
}

.avatar-xl {
    width: 96px;
    height: 96px;
}

.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.avatar-initials.avatar-sm { font-size: 12px; }
.avatar-initials.avatar-lg { font-size: 24px; }

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    margin-right: -10px;
    border: 2px solid white;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    color: var(--gray-400);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--spacing-sm);
}

.empty-state-text {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-bottom: var(--spacing-lg);
}

/* ============================================
   Loading States
   ============================================ */

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.loading-spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.loading-spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.loading-skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
    height: 20px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) var(--gray-100);
}

/* ============================================
   Dividers
   ============================================ */

.divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: var(--spacing-lg) 0;
}

.divider-sm { margin: var(--spacing-md) 0; }
.divider-lg { margin: var(--spacing-xl) 0; }

.divider-dashed {
    border-style: dashed;
}

.divider-text {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--gray-500);
    font-size: var(--font-size-sm);
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.divider-text::before {
    margin-left: var(--spacing-md);
}

.divider-text::after {
    margin-right: var(--spacing-md);
}

/* ============================================
   Ripple Effect
   ============================================ */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    padding-top: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.5s, opacity 0.5s;
}

.ripple:active::after {
    transform: scale(2);
    opacity: 0;
    transition: 0s;
}

/* ============================================
   File Upload
   ============================================ */

.file-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: var(--primary);
    background-color: var(--primary-50);
}

.file-upload-area .upload-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    color: var(--gray-400);
}

.file-upload-area .upload-text {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.file-upload-area .upload-hint {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    margin-top: var(--spacing-sm);
}

/* ============================================
   Timeline
   ============================================ */

.timeline {
    position: relative;
    padding-right: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--spacing-lg);
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -26px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item .timeline-time {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    margin-bottom: var(--spacing-xs);
}

.timeline-item .timeline-content {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

/* ============================================
   Progress
   ============================================ */

.progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-bar.primary { background: var(--primary); }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* ============================================
   Tags
   ============================================ */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    color: var(--gray-600);
}

.tag .tag-remove {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.tag .tag-remove:hover {
    opacity: 1;
    color: var(--danger);
}

/* ============================================
   Copy to Clipboard
   ============================================ */

.copyable {
    cursor: pointer;
    position: relative;
}

.copyable:hover::after {
    content: 'نسخ';
    position: absolute;
    top: -25px;
    right: 50%;
    transform: translateX(50%);
    background: var(--gray-800);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    white-space: nowrap;
}