/* ملف التصميم المتجاوب لموقع ساعدني */

/* =========== شاشات كبيرة جداً (1200px فما فوق) =========== */
@media (min-width: 1200px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .search-form {
        grid-template-columns: 2fr 1.5fr 1fr auto;
    }
    
    .categories-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* =========== شاشات كبيرة (992px إلى 1199px) =========== */
@media (max-width: 1199px) and (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .search-form {
        grid-template-columns: 2fr 1.5fr 1fr auto;
    }
    
    .categories-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .content-wrapper {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========== شاشات متوسطة (768px إلى 991px) =========== */
@media (max-width: 991px) and (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .search-form {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "search search"
            "location category"
            "button button";
        gap: 15px;
    }
    
    .search-form .search-input-group:first-child {
        grid-area: search;
    }
    
    .search-form .search-input-group:nth-child(2) {
        grid-area: location;
    }
    
    .search-form .category-select {
        grid-area: category;
    }
    
    .search-form .search-btn {
        grid-area: button;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .interactive-map {
        height: 400px;
    }
    
    .business-results {
        max-height: 400px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========== شاشات صغيرة (576px إلى 767px) =========== */
@media (max-width: 767px) and (min-width: 576px) {
    .container {
        max-width: 540px;
    }
    
    .navbar {
        padding: 10px 0;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 80%;
        height: calc(100vh - 70px);
        background-color: white;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a {
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 10px;
        justify-content: flex-start;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero {
        padding: 40px 0 30px;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .search-box {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .search-form {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-card {
        padding: 15px 5px;
    }
    
    .category-icon {
        font-size: 1.8rem;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-bottom: 40px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .section-header h2 {
        font-size: 1.3rem;
    }
    
    .interactive-map {
        height: 350px;
    }
    
    .map-controls {
        left: 15px;
        top: 70px;
    }
    
    .map-control-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .business-results {
        max-height: 350px;
    }
    
    .business-card {
        padding: 15px;
    }
    
    .business-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .business-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-action {
        width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-section h3 {
        margin-bottom: 20px;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.4rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .detail-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* =========== شاشات صغيرة جداً (أقل من 576px) =========== */
@media (max-width: 575px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar {
        padding: 8px 0;
    }
    
    .logo a {
        font-size: 1.5rem;
    }
    
    .logo i {
        font-size: 1.8rem;
    }
    
    .hero {
        padding: 30px 0 20px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .search-box {
        padding: 15px;
        margin-bottom: 25px;
    }
    
    .search-form {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .search-input,
    .category-select,
    .search-btn {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .search-icon {
        right: 12px;
        font-size: 1rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .category-card {
        padding: 12px 5px;
    }
    
    .category-icon {
        font-size: 1.6rem;
        margin-bottom: 8px;
    }
    
    .quick-categories h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .main-content {
        padding: 30px 0;
    }
    
    .content-wrapper {
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .btn-secondary {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .interactive-map {
        height: 300px;
    }
    
    .map-controls {
        left: 10px;
        top: 60px;
    }
    
    .map-control-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .filters {
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-select {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .business-results {
        max-height: 300px;
    }
    
    .business-name {
        font-size: 1.1rem;
    }
    
    .business-category {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    .business-address,
    .business-phone,
    .business-hours {
        font-size: 0.9rem;
    }
    
    .featured-section {
        margin-top: 30px;
    }
    
    .featured-image {
        height: 150px;
    }
    
    .featured-content {
        padding: 15px;
    }
    
    .featured-badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
    
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-logo {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .footer-logo i {
        font-size: 1.8rem;
    }
    
    .footer-description {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .footer-links li {
        margin-bottom: 8px;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    .footer-contact li {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding-top: 20px;
    }
    
    .footer-bottom p {
        font-size: 0.85rem;
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 1rem;
    }
    
    /* تحسينات إضافية للهواتف */
    .modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .modal-header {
        padding: 15px;
        position: sticky;
        top: 0;
        z-index: 1;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
        max-width: calc(100% - 40px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .modal-body {
        padding: 15px;
        padding-bottom: 80px; /* مساحة للزر العائم */
    }
    
    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .detail-hours .hour-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* زر عائم للاتصال */
    .floating-call-button {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background-color: var(--success-color);
        color: white;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        text-decoration: none;
    }
    
    .floating-call-button:hover {
        background-color: #05b689;
        transform: translateX(-50%) scale(1.1);
    }
}

/* =========== شاشات قصيرة جداً (أقل من 500px ارتفاعاً) =========== */
@media (max-height: 500px) {
    .hero {
        padding: 20px 0;
    }
    
    .hero-title {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .search-box {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .interactive-map {
        height: 250px;
    }
    
    .business-results {
        max-height: 250px;
    }
    
    .modal-content {
        margin: 10px auto;
    }
}

/* =========== تحسينات للأجهزة التي تدعم اللمس =========== */
@media (hover: none) and (pointer: coarse) {
    .business-card:hover {
        transform: none;
    }
    
    .featured-card:hover {
        transform: none;
    }
    
    .category-card:hover {
        transform: none;
    }
    
    .map-control-btn:hover {
        background-color: white;
        color: var(--dark-color);
    }
    
    .map-control-btn:active {
        background-color: var(--primary-color);
        color: white;
    }
    
    .btn-action:hover {
        opacity: 1;
    }
    
    .btn-action:active {
        opacity: 0.8;
    }
    
    .search-btn:hover {
        transform: none;
        background-color: var(--secondary-color);
    }
    
    .search-btn:active {
        transform: translateY(-2px);
        background-color: #e11575;
    }
    
    /* زيادة حجم أزرار اللمس */
    .business-actions .btn-action,
    .detail-actions .btn-action {
        padding: 12px;
        min-height: 44px; /* الحد الأدنى لللمس */
    }
    
    .filter-select,
    .category-select {
        min-height: 44px;
    }
    
    .search-input {
        min-height: 44px;
    }
    
    .nav-links a {
        min-height: 44px;
        align-items: center;
    }
}

/* =========== تحسينات للوضع الأفقي على الهواتف =========== */
@media (max-width: 991px) and (orientation: landscape) {
    .hero {
        padding: 20px 0;
    }
    
    .search-box {
        margin-bottom: 20px;
    }
    
    .interactive-map {
        height: 250px;
    }
    
    .business-results {
        max-height: 250px;
    }
    
    .nav-links {
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .modal-content {
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* =========== تحسينات للشاشات عالية الدقة =========== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .logo i,
    .category-icon,
    .featured-image i {
        filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
    }
}

/* =========== تحسينات الوصول وإمكانية الاستخدام =========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --primary-color: #0033cc;
        --secondary-color: #cc0033;
        --success-color: #006600;
        --danger-color: #cc0000;
    }
}

@media (prefers-color-scheme: dark) {
    /* يمكن إضافة وضع داكن في المستقبل */
}

/* =========== طباعة =========== */
@media print {
    .header,
    .hero,
    .map-section,
    .map-controls,
    .footer,
    .search-box,
    .business-actions,
    .btn-action,
    .social-links,
    .view-all,
    .featured-badge,
    .floating-call-button {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt !important;
        line-height: 1.5 !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
    
    .business-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        margin-bottom: 15px !important;
    }
    
    .business-results {
        max-height: none !important;
        overflow: visible !important;
    }
    
    a {
        color: black !important;
        text-decoration: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
    }
    
    .footer-bottom p {
        opacity: 1 !important;
        color: black !important;
    }
}

/* =========== قسم الإحصائيات المحسن =========== */

.stats-section {
    margin-top: 60px;
    padding: 40px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%234361ee" fill-opacity="0.05" d="M0,224L48,213.3C96,203,192,181,288,181.3C384,181,480,203,576,192C672,181,768,139,864,138.7C960,139,1056,181,1152,192C1248,203,1344,181,1392,170.7L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.stats-section .section-header {
    position: relative;
    z-index: 1;
    margin-bottom: 40px;
}

.stats-section .section-header h2 {
    font-size: 2rem;
    color: var(--dark-color);
    position: relative;
    display: inline-block;
}

.stats-section .section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* شبكة الإحصائيات */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    position: relative;
    z-index: 1;
}

/* بطاقة الإحصائية */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border-top: 5px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.05) 0%, rgba(247, 37, 133, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:nth-child(1) {
    border-top-color: var(--danger-color);
}

.stat-card:nth-child(2) {
    border-top-color: var(--secondary-color);
}

.stat-card:nth-child(3) {
    border-top-color: var(--success-color);
}

.stat-card:nth-child(4) {
    border-top-color: var(--accent-color);
}

/* أيقونة الإحصائية */
.stat-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, var(--danger-color), #d63384);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, var(--secondary-color), #c2185b);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, var(--success-color), #00b894);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, var(--accent-color), #00bbf9);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon i {
    font-size: 2rem;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* الرقم الإحصائي */
.stat-number {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card:hover .stat-number {
    color: var(--primary-color);
    text-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.stat-number::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 50%;
    transform: translateX(50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    opacity: 0.5;
    transition: width 0.3s ease;
}

.stat-card:hover .stat-number::after {
    width: 80px;
}

/* تسمية الإحصائية */
.stat-label {
    font-size: 1.1rem;
    color: var(--gray-dark);
    font-weight: 600;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card:hover .stat-label {
    color: var(--primary-dark);
    letter-spacing: 2px;
}

/* مؤشرات الأداء */
.stat-indicator {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
    animation: pulse 2s infinite;
}

.stat-card:nth-child(1) .stat-indicator {
    background-color: var(--danger-color);
    box-shadow: 0 0 10px var(--danger-color);
}

.stat-card:nth-child(2) .stat-indicator {
    background-color: var(--secondary-color);
    box-shadow: 0 0 10px var(--secondary-color);
}

.stat-card:nth-child(3) .stat-indicator {
    background-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}

.stat-card:nth-child(4) .stat-indicator {
    background-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

/* زر عرض المزيد من الإحصائيات */
.stats-more {
    text-align: center;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

.stats-toggle-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.stats-toggle-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
}

.stats-toggle-btn i {
    transition: transform 0.3s ease;
}

.stats-toggle-btn.active i {
    transform: rotate(180deg);
}

/* إحصائيات إضافية (تظهر عند النقر) */
.additional-stats {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    animation: fadeInUp 0.5s ease;
}

.additional-stats.show {
    display: grid;
}

.additional-stat {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.additional-stat .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.additional-stat .stat-description {
    font-size: 0.9rem;
    color: var(--gray-dark);
}

/* مخطط دائري صغير داخل البطاقة */
.stat-progress {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.35s;
}

.stat-card:nth-child(1) .progress-ring-circle {
    stroke: var(--danger-color);
}

.stat-card:nth-child(2) .progress-ring-circle {
    stroke: var(--secondary-color);
}

.stat-card:nth-child(3) .progress-ring-circle {
    stroke: var(--success-color);
}

.stat-card:nth-child(4) .progress-ring-circle {
    stroke: var(--accent-color);
}

/* تأثيرات متحركة للأرقام */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(67, 97, 238, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تحسينات للهواتف */
@media (max-width: 768px) {
    .stats-section {
        padding: 30px 0;
        margin-top: 40px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px 15px;
        min-height: 180px;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }
    
    .stat-icon i {
        font-size: 1.8rem;
    }
    
    .stat-number {
        font-size: 2.2rem;
        min-height: 40px;
    }
    
    .stat-label {
        font-size: 1rem;
    }
    
    .stats-section .section-header h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        min-height: 160px;
        padding: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}



/* تنسيقات إضافية للإحصائيات */

.stats-subtitle {
    font-size: 0.9rem;
    color: var(--gray-medium);
    font-weight: 400;
    margin-right: 10px;
    display: block;
    margin-top: 5px;
}

.stats-update-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--gray-medium);
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 15px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.stats-update-time i {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stat-trend {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
}

.trend-up {
    color: var(--success-color);
}

.trend-down {
    color: var(--danger-color);
}

.trend-value {
    font-weight: 600;
}

/* تأثيرات للتواصل مع المستخدم */
.completed {
    animation: celebrate 0.5s ease;
}

@keyframes celebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.updating {
    animation: pulseUpdate 1s infinite;
}

@keyframes pulseUpdate {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* زر التصدير */
#export-stats {
    margin-right: 15px;
    background: var(--gray-light);
    color: var(--dark-color);
}

#export-stats:hover {
    background: var(--gray-medium);
}