/* ═══════════════════════════════════════════════
   أسعار الصرف - الريال اليمني
   ملف CSS الرئيسي الموحد
   ═══════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════
   المتغيرات (CSS Variables)
   ═══════════════════════════════════════════════ */
:root {
    --bg-primary: #f2f4f8;
    --bg-secondary: #fff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --border-color: #dee2e6;
}

[data-theme="dark"] {
    --bg-primary: #1a1d29;
    --bg-secondary: #252936;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --accent-primary: #7c8adb;
    --accent-secondary: #9067c6;
    --success-color: #3dd365;
    --danger-color: #ff6b6b;
    --border-color: #3a3f51;
}

/* ═══════════════════════════════════════════════
   إعدادات عامة
   ═══════════════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════
   الحاوية الرئيسية
   ═══════════════════════════════════════════════ */
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ═══════════════════════════════════════════════
   التحكمات والبحث
   ═══════════════════════════════════════════════ */
.controls-section {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-box {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.search-box:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ═══════════════════════════════════════════════
   أزرار الفلترة
   ═══════════════════════════════════════════════ */
.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

/* ═══════════════════════════════════════════════
   التبديل بين العروض
   ═══════════════════════════════════════════════ */
.view-toggle {
    display: flex;
    gap: 5px;
    background: var(--bg-primary);
    padding: 5px;
    border-radius: 10px;
}

.view-btn {
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

/* ═══════════════════════════════════════════════
   البطاقات المميزة
   ═══════════════════════════════════════════════ */
.featured-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.featured-card {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.featured-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.featured-card-content {
    position: relative;
    z-index: 1;
}

.currency-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.currency-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.featured-price {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.featured-change {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════
   لوحة الإحصائيات
   ═══════════════════════════════════════════════ */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════
   حاسبة التحويل
   ═══════════════════════════════════════════════ */
.converter-section {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.converter-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.converter-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: end;
}

.converter-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.converter-input-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.converter-input,
.converter-select {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1.1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.converter-select {
    cursor: pointer;
}

.swap-btn {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.swap-btn:hover {
    background: var(--accent-secondary);
    transform: rotate(180deg);
}

.city-btn {
    padding: 10px 25px;
    border: 2px solid var(--accent-primary);
    background: transparent;
    color: var(--accent-primary);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

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

/* ═══════════════════════════════════════════════
   الرسوم البيانية
   ═══════════════════════════════════════════════ */
.chart-section {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

#priceChart {
    max-height: 300px;
}

/* إحصائيات الرسم البياني */
.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card.stat-high {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    border-color: var(--success-color);
}

.stat-card.stat-low {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    border-color: var(--danger-color);
}

.stat-card.stat-change {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.1));
    border-color: var(--accent-primary);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-high .stat-icon {
    background: var(--success-color);
    color: white;
}

.stat-low .stat-icon {
    background: var(--danger-color);
    color: white;
}

.stat-change .stat-icon {
    background: var(--accent-primary);
    color: white;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-percent {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 3px;
}

@media (max-width: 768px) {
    .chart-stats {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }
}

/* ═══════════════════════════════════════════════
   رأس القسم
   ═══════════════════════════════════════════════ */
.section-header {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.update-timer {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════
   الجداول
   ═══════════════════════════════════════════════ */
.table-container {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.rate-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.rate-table thead th {
    background: var(--bg-primary);
    padding: 15px 12px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    font-size: 0.95rem;
    position: sticky;
    top: 0;
    z-index: 10;
    border: none;
}

.rate-table tbody tr {
    background: var(--bg-secondary);
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
}

.rate-table tbody tr:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
    border-color: var(--accent-primary);
}

.rate-table td {
    padding: 18px 12px;
    border: none;
    vertical-align: middle;
    text-align: center;
    background: var(--bg-secondary);
}

.rate-table tbody tr td:first-child {
    border-radius: 10px 0 0 10px;
}

.rate-table tbody tr td:last-child {
    border-radius: 0 10px 10px 0;
}

.flag-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
}

.currency-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.price-sell {
    color: var(--success-color);
    font-weight: 700;
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
}

.price-buy {
    color: var(--danger-color);
    font-weight: 700;
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
}

/* ═══════════════════════════════════════════════
   مؤشرات الاتجاه
   ═══════════════════════════════════════════════ */
.trend-icon {
    font-size: 1.5rem;
    display: inline-block;
}

.trend-up {
    color: var(--danger-color);
    animation: bounce 1s infinite;
}

.trend-down {
    color: var(--success-color);
    animation: bounce 1s infinite;
}

.trend-stable {
    color: var(--text-secondary);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.change-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.change-positive {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.change-negative {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.high-low {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.city-diff {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════
   أزرار المشاركة
   ═══════════════════════════════════════════════ */
.share-btn {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.share-btn:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════════
   نافذة المشاركة المنبثقة
   ═══════════════════════════════════════════════ */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.share-modal.show {
    display: flex;
}

.share-modal-content {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s;
}

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

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.share-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-modal {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

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

.share-info {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.share-info .currency-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.share-info .prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.share-info .price-item {
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.share-info .price-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.share-info .price-value {
    font-size: 1.3rem;
    font-weight: 700;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.social-share-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.social-share-btn i {
    font-size: 1.2rem;
}

.whatsapp-btn {
    background: #25D366;
}

.whatsapp-btn:hover {
    background: #1da851;
}

.facebook-btn {
    background: #1877F2;
}

.facebook-btn:hover {
    background: #0d65d9;
}

.twitter-btn {
    background: #1DA1F2;
}

.twitter-btn:hover {
    background: #0d8bd9;
}

.telegram-btn {
    background: #0088cc;
}

.telegram-btn:hover {
    background: #006ba8;
}

.copy-btn-modal {
    background: var(--accent-primary);
    grid-column: 1 / -1;
}

.copy-btn-modal:hover {
    background: var(--accent-secondary);
}

/* ═══════════════════════════════════════════════
   عرض البطاقات
   ═══════════════════════════════════════════════ */
.cards-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    display: none;
}

.cards-view.active {
    display: grid;
}

.currency-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.currency-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

/* ═══════════════════════════════════════════════
   مؤشر التحميل
   ═══════════════════════════════════════════════ */
.loader {
    border: 6px solid var(--border-color);
    border-top: 6px solid var(--accent-primary);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

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

/* ═══════════════════════════════════════════════
   الإشعارات
   ═══════════════════════════════════════════════ */
.notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: #fff;
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: none;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        top: 50px;
        opacity: 0;
    }
    to {
        top: 100px;
        opacity: 1;
    }
}

.notification.show {
    display: block;
}

/* ═══════════════════════════════════════════════
   التصميم المتجاوب (Responsive)
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.3rem;
    }

    .featured-price {
        font-size: 2rem;
    }

    .converter-inputs {
        grid-template-columns: 1fr;
    }

    .swap-btn {
        transform: rotate(90deg);
    }

    .rate-table {
        font-size: 0.85rem;
    }

    .flag-img {
        width: 35px;
        height: 35px;
    }

    .price-sell,
    .price-buy {
        font-size: 1rem;
    }

    .share-buttons {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════
   Lazy Loading للصور
   ═══════════════════════════════════════════════ */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img.lazy.loaded {
    opacity: 1;
}

/* Placeholder للصور أثناء التحميل */
img[data-src] {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--border-color) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* ═══════════════════════════════════════════════
   Skeleton Loaders
   ═══════════════════════════════════════════════ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--border-color) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 15px;
    border-radius: 6px;
}

.skeleton-card {
    height: 120px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.skeleton-table-row {
    height: 50px;
    margin-bottom: 10px;
    border-radius: 10px;
}

.skeleton-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

/* Skeleton للبطاقات المميزة */
.featured-card.skeleton {
    min-height: 200px;
}

/* Skeleton للجداول */
.rate-table.loading tbody tr {
    opacity: 0.5;
    pointer-events: none;
}

/* تأثير Pulse للعناصر أثناء التحميل */
.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Loader دوار */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* إخفاء Skeleton بعد التحميل */
.loaded .skeleton {
    display: none;
}

/* ═══════════════════════════════════════════════
   تحسينات Animations و Transitions
   ═══════════════════════════════════════════════ */

/* تحسين transitions العامة */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fade in animation للعناصر عند التحميل */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Slide in من اليمين */
.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

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

/* Slide in من اليسار */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale in animation */
.scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* تحسين hover للبطاقات */
.featured-card,
.stat-card,
.info-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-card:hover,
.stat-card:hover,
.info-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
}

/* تحسين hover للأزرار */
.btn,
button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before,
button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before,
button:hover::before {
    width: 300px;
    height: 300px;
}

/* تأثير ripple للعناصر القابلة للنقر */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}

/* تحسين transitions للجداول */
.rate-table tbody tr {
    transition: all 0.3s ease;
}

.rate-table tbody tr:hover {
    transform: translateX(-5px);
    box-shadow: 5px 0 15px rgba(102, 126, 234, 0.15);
}

/* تأثير smooth scroll */
html {
    scroll-behavior: smooth;
}

/* تحسين focus states */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

/* تأثير loading للأزرار */
.btn-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Stagger animation للقوائم */
.stagger-item {
    animation: fadeInUp 0.5s ease-out backwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }

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

/* تأثير bounce للعناصر المهمة */
.bounce {
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* تحسين page transitions */
.page-transition {
    animation: pageTransition 0.5s ease-in-out;
}

@keyframes pageTransition {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Reduce motion للمستخدمين الذين يفضلون ذلك */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ═══════════════════════════════════════════════
   الرسم البياني - صفحة العملة
   ═══════════════════════════════════════════════ */

.chart-section-currency {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* أزرار التحكم */
.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0 30px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
}

.chart-period-selector,
.chart-city-selector {
    display: flex;
    gap: 10px;
}

.period-btn,
.city-toggle-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.period-btn:hover,
.city-toggle-btn:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.period-btn.active,
.city-toggle-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* إحصائيات الرسم البياني */
.currency-chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.city-stats-group {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.city-stats-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--accent-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-card-mini {
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-card-mini.stat-high {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
}

.stat-card-mini.stat-low {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
}

.stat-card-mini.stat-change {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(102, 126, 234, 0.05));
}

.stat-card-mini.stat-volatility {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
}

.stat-card-mini .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-card-mini .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* بطاقة الفرق */
.difference-stats {
    grid-column: 1 / -1;
}

.stat-card-highlight {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.stat-card-highlight i {
    font-size: 2.5rem;
}

.stat-card-highlight .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value-large {
    font-size: 2rem;
    font-weight: 700;
    margin: 5px 0;
}

.stat-description {
    font-size: 1rem;
    opacity: 0.9;
}

/* الرسم البياني نفسه */
.chart-loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.chart-loading i {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

#currencyChartContainer {
    position: relative;
    height: 400px;
    margin-top: 20px;
}

#currencyHistoryChart {
    max-height: 400px;
}

/* Responsive */
@media (max-width: 768px) {
    .chart-controls {
        flex-direction: column;
    }

    .chart-period-selector,
    .chart-city-selector {
        flex-wrap: wrap;
        justify-content: center;
    }

    .period-btn,
    .city-toggle-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .currency-chart-stats {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card-highlight {
        flex-direction: column;
        text-align: center;
    }

    #currencyChartContainer {
        height: 300px;
    }
}

/* ═══════════════════════════════════════════════
   نهاية الملف
   ═══════════════════════════════════════════════ */
