/* assets/css/style.css - نسخة كاملة ومحدثة */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

/* ===== تحسينات عامة ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    position: relative;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: all 0.3s ease;
    min-height: 100vh;
    direction: rtl;
    padding-bottom: 80px;
    font-size: clamp(14px, 2vw, 16px);
    overflow-x: hidden !important;
}

/* ===== المتغيرات ===== */
:root {
    --primary-color: #8B0000;
    --primary-hover: #c1121f;
    --primary-light: rgba(230, 57, 70, 0.1);
    --secondary-color: #1da1f2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --gold-color: #d4af37;
    --gold-light: rgba(212, 175, 55, 0.15);
    
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    --border-radius: 12px;
    --bottom-nav-height: 70px;
    --sidebar-width: 280px;
    --gradient-primary: linear-gradient(135deg, #e63946, #ff6b6b);
}

[data-theme="dark"] {
    --primary-color: #ff6b6b;
    --primary-hover: #ff5252;
    --primary-light: rgba(255, 107, 107, 0.15);
    --gold-color: #f5c542;
    --gold-light: rgba(245, 197, 66, 0.12);
    
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border-color: #333333;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
    --gradient-primary: linear-gradient(135deg, #ff6b6b, #ff4444);
}

/* ===== شريط التمرير ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* ===== الهيدر ===== */
.main-header {
    background: var(--bg-secondary);
    padding: 10px 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    font-weight: 900;
    text-decoration: none;
    transition: var(--transition);
    font-family: 'Tajawal', sans-serif;
}

.logo .white { color: var(--text-primary); }
.logo .red { color: var(--primary-color); }

.logo:hover {
    transform: scale(1.02);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    text-decoration: none;
}

.header-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.header-btn i {
    font-size: 16px;
}

.menu-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.menu-toggle:hover {
    transform: scale(1.05) rotate(90deg);
}

/* ===== الحاويات الرئيسية ===== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 15px;
    overflow-x: hidden;
}

/* ===== القسم الرائج ===== */
.trending-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.trending-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.trending-header i {
    color: var(--primary-color);
    font-size: 16px;
}

.trending-header h2 {
    font-size: 15px;
    font-weight: 700;
}

.trending-slider {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 5px 0;
    scroll-behavior: smooth;
}

.trending-item {
    min-width: 90px;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.trending-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.trending-item img {
    width: 100%;
    height: 60px;
    object-fit: cover;
}

.trending-info {
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    flex-wrap: wrap;
}

.trending-likes {
    font-size: 9px;
    color: var(--text-muted);
}

/* ===== قسم المستخدمين الأكثر متابعة ===== */
.top-users-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.users-header h3 {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.user-card {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.user-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.user-card-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 5px;
    border: 2px solid var(--border-color);
}

.user-card-name {
    font-weight: 700;
    font-size: 11px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-username {
    font-size: 9px;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.user-card-stats {
    font-size: 9px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.user-card-btn {
    width: 100%;
    padding: 4px;
    border: none;
    border-radius: 20px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    transition: var(--transition);
}

.user-card-btn.following {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* ===== نموذج التغريدة ===== */
.tweet-form-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.tweet-form-header {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.form-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

#tweetForm textarea {
    flex: 1;
    min-height: 60px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    resize: vertical;
}

#tweetForm textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.tweet-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.image-upload {
    cursor: pointer;
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--border-color);
    font-size: 12px;
}

.image-upload:hover {
    background: var(--primary-color);
    color: white;
}

.image-upload input {
    display: none;
}

.tweet-submit {
    padding: 6px 15px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tweet-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ===== التغريدات ===== */
.tweets-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.tweet {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
}

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

.promoted-tweet {
    border: 2px solid var(--gold-color);
    background: linear-gradient(45deg, var(--bg-secondary), var(--gold-light));
}

.promoted-badge {
    position: absolute;
    top: -10px;
    right: 15px;
    background: linear-gradient(135deg, var(--gold-color), #b8860b);
    color: #fff;
    padding: 3px 12px;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
}

.tweet-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tweet-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.tweet-user-info {
    flex: 1;
}

.tweet-user-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.tweet-username {
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.tweet-display-name {
    font-size: 12px;
    color: var(--text-secondary);
}

.tweet-time {
    color: var(--text-muted);
    font-size: 10px;
    margin-right: auto;
}

.tweet-follow-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tweet-follow-btn.following {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.send-gift-btn {
    background: linear-gradient(135deg, var(--gold-color), #b8860b);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.send-gift-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.tweet-content {
    margin-bottom: 10px;
    cursor: pointer;
}

.tweet-content p {
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 13px;
    word-wrap: break-word;
}

/* ===== تنسيقات الصور ===== */
.tweet-image {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
    background: var(--bg-tertiary);
}

.tweet-images-slider {
    position: relative;
    margin: 8px 0;
    border-radius: 12px;
    overflow: hidden;
    max-height: 300px;
}

.slider-container {
    display: flex;
    transition: transform 0.3s ease;
}

.slider-item {
    flex: 0 0 100%;
    display: none;
    text-align: center;
    background: var(--bg-tertiary);
}

.slider-item.active {
    display: block;
}

.slider-item img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 10;
}

.slider-nav.prev { left: 8px; }
.slider-nav.next { right: 8px; }

.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    background: rgba(0,0,0,0.5);
    padding: 4px 10px;
    border-radius: 20px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

/* ===== تذييل التغريدة ===== */
.tweet-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    gap: 10px;
}

.tweet-stats {
    display: flex;
    gap: 12px;
    color: var(--text-muted);
    font-size: 11px;
}

.tweet-stats span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.tweet-actions {
    display: flex;
    gap: 5px;
}

.tweet-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
}

.tweet-actions button:hover {
    background: var(--bg-tertiary);
}

.like-btn.liked {
    color: var(--primary-color);
}

/* ===== تنسيق اسم المدير العصري ===== */
.admin-badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--gold-light);
    backdrop-filter: blur(4px);
    padding: 3px 10px 3px 8px;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 500;
    color: var(--gold-color);
    border: 1px solid var(--gold-color);
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    margin-right: 5px;
}

.admin-badge-modern i {
    font-size: 10px;
    color: var(--gold-color);
}

.admin-gold-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 3px;
}

.admin-gold-badge i {
    font-size: 14px;
    color: var(--gold-color);
}

.verified-badge {
    color: var(--secondary-color);
    font-size: 13px;
    margin-left: 3px;
}

/* ===== شارة الماسات ===== */
.diamonds-badge {
    background: linear-gradient(135deg, var(--gold-color), #b8860b);
    color: white;
    padding: 3px 8px;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 0 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ===== روابط التواصل ===== */
.social-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 30px;
    color: white;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    margin: 2px;
    transition: all 0.2s ease;
}

.social-link:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

/* ===== نافذة الهدية ===== */
.gift-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gift-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.gift-modal-container {
    background: var(--bg-secondary);
    border-radius: 24px;
    width: 90%;
    max-width: 360px;
    overflow: hidden;
    transform: scale(0.95);
    transition: all 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
}

.gift-modal-overlay.active .gift-modal-container {
    transform: scale(1);
}

.gift-modal-header {
    background: linear-gradient(135deg, var(--primary-color), #c1121f);
    padding: 20px;
    text-align: center;
}

.gift-icon {
    width: 55px;
    height: 55px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    color: var(--gold-color);
}

.gift-modal-header h3 {
    color: white;
    font-size: 18px;
    margin: 0;
}

.gift-modal-header p {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    margin-top: 5px;
}

.gift-modal-body {
    padding: 20px;
}

.gift-amount-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.gift-quick-btn {
    background: var(--bg-tertiary);
    border: none;
    padding: 8px 14px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.gift-quick-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.gift-quick-btn.gold {
    background: linear-gradient(135deg, var(--gold-color), #b8860b);
    color: white;
    border: none;
}

.gift-custom-input {
    margin-bottom: 20px;
}

.gift-custom-input input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 40px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    text-align: center;
    font-weight: 600;
}

.gift-custom-input input:focus {
    outline: none;
    border-color: var(--gold-color);
}

.gift-send-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--gold-color), #b8860b);
    border: none;
    border-radius: 40px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.gift-send-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.gift-cancel-button {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 40px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
}

.gift-cancel-button:hover {
    background: var(--bg-tertiary);
}

/* ===== تعليق الهدية ===== */
.comment-gift {
    background: var(--gold-light);
    border-right: 3px solid var(--gold-color);
    position: relative;
}

.gift-message {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, var(--gold-color), #b8860b);
    padding: 3px 10px;
    border-radius: 30px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* ===== النوافذ المنبثقة ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 20px;
    max-width: 450px;
    width: 90%;
    margin: 50px auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header h2 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

/* ===== أزرار الإغلاق - تم إزالة الإخفاء التلقائي ===== */
.close-modal, .popup-close, .close-chat, .close, [class*="close"] {
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover, .popup-close:hover, .close-chat:hover, .close:hover {
    transform: rotate(90deg);
    background: rgba(0,0,0,0.8);
}

/* ===== زر الدعم ===== */
.support-chat {
    position: fixed;
    bottom: 85px;
    left: 15px;
    z-index: 100;
}

.support-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(37,211,102,0.3);
    transition: var(--transition);
    text-decoration: none;
}

.support-btn:hover {
    transform: scale(1.08);
}

/* ===== حالة عدم وجود نتائج ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    color: var(--border-color);
}

.empty-state h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-state-btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    margin-top: 12px;
}

/* ===== تذييل الصفحة ===== */
.site-footer {
    margin-top: 40px;
    padding: 20px;
    border-top: 2px solid var(--border-color);
    text-align: center;
}

.footer-privacy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 30px;
    font-size: 12px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.footer-privacy:hover {
    background: var(--primary-color);
    color: white;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 11px;
}

/* ===== معاينة الصور ===== */
.images-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-primary);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-preview {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

/* ===== مؤشر التحميل ===== */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== إشعارات ===== */
.notification-toast {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    max-width: 320px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    padding: 12px 16px;
    z-index: 5000;
    animation: slideIn 0.3s ease;
    border-right: 3px solid var(--primary-color);
    cursor: pointer;
}

.notification-toast.success { border-right-color: var(--success-color); }
.notification-toast.error { border-right-color: var(--danger-color); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.diamond-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--gold-color), #b8860b);
    color: white;
    padding: 10px 20px;
    border-radius: 40px;
    font-weight: 700;
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(212,175,55,0.3);
}

/* ===== تحسينات متجاوبة ===== */
@media (max-width: 768px) {
    .container { padding: 10px; }
    .tweet-image, .slider-item img { max-height: 250px; }
    .gift-modal-container { max-width: 320px; }
    .gift-quick-btn { padding: 6px 12px; font-size: 12px; }
}

@media (max-width: 480px) {
    .tweet-image, .slider-item img { max-height: 200px; }
    .admin-badge-modern { font-size: 9px; padding: 2px 8px; }
    .send-gift-btn { padding: 2px 8px; font-size: 9px; }
    .gift-quick-btn { padding: 5px 10px; font-size: 11px; }
}

/* ===== عناصر إضافية ===== */
.mention {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    background: var(--primary-light);
    padding: 2px 5px;
    border-radius: 4px;
}

.hashtag {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    background: rgba(212,175,55,0.1);
    padding: 2px 5px;
    border-radius: 4px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 12px;
    text-decoration: none;
}

.back-button:hover {
    background: var(--primary-color);
    color: white;
}

/* ===== إصلاح مشكلة الـ Overlay ===== */
.modal,
.image-modal,
.chat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.show,
.image-modal.show,
.chat-modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 20px;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== زر حذف التعليق ===== */
.comment-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 15px;
    transition: all 0.2s ease;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.comment-delete-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    transform: scale(1.05);
}

.comment-delete-btn i {
    font-size: 11px;
}

/* ===== تنسيقات التعليق المحسنة ===== */
.comment-full {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    position: relative;
}

.comment-full:hover {
    border-color: var(--primary-color);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-username {
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.comment-display-name {
    font-size: 11px;
    color: var(--text-secondary);
}

.comment-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-right: auto;
}

.comment-content {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
    padding-right: 40px;
    color: var(--text-primary);
}

.comment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-right: 40px;
}

.comment-like-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 11px;
    transition: all 0.2s ease;
}

.comment-like-btn.liked {
    color: var(--primary-color);
}

/* ===== نافذة اختيار نوع النشر ===== */
.post-options-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.post-options-container {
    background: var(--bg-secondary);
    border-radius: 28px;
    width: 90%;
    max-width: 380px;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.post-options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.post-options-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.close-options {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.close-options:hover {
    color: var(--danger-color);
    transform: rotate(90deg);
}

.post-options-buttons {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.post-option-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: right;
}

.post-option-btn:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.post-option-btn i {
    font-size: 32px;
}

.tweet-option i {
    color: var(--primary-color);
}

.reel-option i {
    color: #ffd700;
}

.option-text {
    text-align: right;
    flex: 1;
}

.option-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.option-text span {
    font-size: 12px;
    color: var(--text-muted);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== تنسيقات الريلز المميز ===== */
.reel-item.promoted-reel {
    border: 3px solid #d4af37 !important;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.6) !important;
    position: relative;
    transition: all 0.3s ease;
}

.reel-item.promoted-reel .reel-like-btn.liked {
    background: rgba(212, 175, 55, 0.3) !important;
    color: #d4af37 !important;
}

.reel-item.promoted-reel .reel-like-btn.liked i {
    color: #d4af37 !important;
}

.reel-item.promoted-reel .reel-like-btn:hover {
    background: rgba(212, 175, 55, 0.2) !important;
}

.promoted-reel-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #d4af37, #b8860b);
    color: white;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: goldPulse 2s infinite;
}

@keyframes goldPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); }
}

/* ===== تنسيقات إضافية للريلز ===== */
.reel-title {
    font-size: 14px;
    font-weight: 600;
    margin: 8px 0;
    color: white;
    text-shadow: 0 0 3px black;
}

.reel-caption {
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 0 2px black;
}

.reel-username-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.reel-username-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ===== شريط تقدم الريلز ===== */
.reel-progress-container {
    position: absolute;
    bottom: 80px;
    left: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    padding: 8px 12px;
    border-radius: 30px;
    z-index: 25;
    backdrop-filter: blur(5px);
}

.reel-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
}

.reel-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--primary-color);
    transition: width 0.1s linear;
}

.reel-time-info {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 11px;
    color: white;
    text-shadow: 0 0 2px black;
}

/* ===== مؤشر تحميل الريلز ===== */
.reel-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.reel-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== زر أتابعه ===== */
.reel-follow-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.reel-follow-btn:hover {
    background: var(--primary-color);
}

/* ===== نافذة نشر الخلفية ===== */
.background-upload-notification {
    position: fixed;
    bottom: 90px;
    left: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease;
}

.background-upload-progress {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.background-upload-fill {
    width: 0%;
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

/* ===== الشريط السفلي ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s ease;
    padding: 5px 12px;
    border-radius: 30px;
    position: relative;
}

.nav-item i {
    font-size: 20px;
}

.nav-item span {
    font-size: 10px;
}

.nav-item.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

.nav-item:hover:not(.active) {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.nav-item.post-btn {
    background: var(--gradient-primary);
    color: white;
    padding: 8px 20px;
    border-radius: 40px;
    margin-top: -15px;
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

.nav-item.post-btn i {
    font-size: 18px;
}

.nav-item.post-btn span {
    font-size: 11px;
    font-weight: 600;
}

.nav-item.post-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(233, 69, 96, 0.5);
}

.diamond-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #d4af37, #b8860b);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
}

@media (max-width: 480px) {
    .bottom-nav {
        padding: 6px 8px;
    }
    .nav-item {
        padding: 4px 8px;
    }
    .nav-item i {
        font-size: 18px;
    }
    .nav-item span {
        font-size: 9px;
    }
    .nav-item.post-btn {
        padding: 6px 16px;
    }
}

/* ===== إصلاح مشكلة الـ Overlay المتبقية ===== */
body.modal-open {
    overflow: hidden;
}

.modal:empty,
.image-modal:empty,
.chat-modal:empty {
    display: none !important;
}

/* ===== تعليقات الريلز ===== */
.reel-comments-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 10001;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.reel-comments-container {
    background: var(--bg-secondary);
    width: 100%;
    max-width: 500px;
    height: 70vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.reel-comments-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reel-comments-header h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-comments {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.reel-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.reel-comment {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.reel-comment .comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.reel-comment .comment-content {
    flex: 1;
}

.reel-comment .comment-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.reel-comment .comment-username {
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.reel-comment .comment-time {
    font-size: 10px;
    color: var(--text-muted);
}

.reel-comment .comment-text {
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 5px;
}

.reel-comment .comment-actions {
    display: flex;
    gap: 10px;
}

.reel-comment .comment-like-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.reel-comment .comment-like-btn.liked {
    color: var(--primary-color);
}

.reel-comments-footer {
    padding: 10px;
    border-top: 1px solid var(--border-color);
}

.reel-comment-form {
    display: flex;
    gap: 10px;
}

.reel-comment-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
}

.reel-comment-form button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
}

.loading-comments {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

.spinner-small {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.empty-comments {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}