﻿/* ====================================
   Layout Mobile CSS - النسخة المحدثة
   خاص بـ _Layout.cshtml
==================================== */

* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Header */
.header {
    padding: 15px 0;
}

    .header .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    .header .logo img {
        max-height: 50px;
    }

/* Cart Icon */
.cart-icon {
    position: relative;
    padding: 8px;
}

    .cart-icon i {
        font-size: 1.5rem;
    }

.cart-count {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ====================================
   تحسينات للموبايل (يتم التحكم بها من main.js)
==================================== */

/* إخفاء أيقونة القائمة على الشاشات الكبيرة */
@media (min-width: 1200px) {
    .mobile-nav-toggle {
        display: none !important;
    }
}

/* إظهار أيقونة القائمة على الشاشات الصغيرة */
@media (max-width: 1199px) {
    .mobile-nav-toggle {
        display: inline-block !important;
    }
}

/* Tablet & Mobile Improvements */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .page-title h1 {
        font-size: 1.8rem;
    }

    .card {
        margin-bottom: 20px;
    }

    .card-header {
        padding: 15px;
    }

    .card-body {
        padding: 15px;
    }
}

/* Small Mobile */
@media (max-width: 576px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }

    .cart-icon i {
        font-size: 1.3rem;
    }

    .cart-count {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .breadcrumb {
        font-size: 0.85rem;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 5px;
    }
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table {
        font-size: 0.85rem;
    }

        .table td,
        .table th {
            padding: 8px;
        }
}

/* Buttons */
@media (max-width: 768px) {
    .btn {
        white-space: normal;
        word-wrap: break-word;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 0.85rem;
    }
}

/* Forms */
@media (max-width: 768px) {
    .form-control,
    .form-select {
        font-size: 16px; /* منع التكبير التلقائي في iOS */
    }

    .form-label {
        font-size: 0.95rem;
    }
}

/* Footer */
@media (max-width: 768px) {
    .footer .footer-top {
        padding: 40px 0;
    }

    .footer h4 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .footer ul li {
        padding: 5px 0;
        font-size: 0.9rem;
    }

    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

/* Performance Improvements */
* {
    -webkit-tap-highlight-color: transparent;
}

img {
    image-rendering: -webkit-optimize-contrast;
}

button,
a {
    touch-action: manipulation;
}

/* إصلاح تداخل القائمة */
.navmenu {
    position: relative;
    z-index: 1;
}

.mobile-nav-toggle {
    position: relative;
    z-index: 9999;
}

/* تحسين الأداء للأنيميشن */
.navmenu,
.mobile-nav-toggle {
    will-change: transform;
}

/* ====================================
   My Subscriptions Page CSS
   خاص بصفحة اشتراكاتي
==================================== */

/* بطاقة الاشتراك النشط */
.active-subscription-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

    .active-subscription-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.15);
        border-color: #28a745;
    }

    /* Header البطاقة */
    .active-subscription-card .card-header {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
        color: white;
        padding: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

        .active-subscription-card .card-header h3 {
            font-size: 1.3rem;
            font-weight: 700;
            margin: 0;
        }

    /* Body البطاقة */
    .active-subscription-card .card-body {
        padding: 25px;
    }

/* عنصر التفاصيل */
.detail-item {
    border-left: 4px solid #ffc107;
    background: #f8f9fa;
    border-radius: 8px;
}

/* تفاصيل الاشتراك */
.subscription-details p {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    color: #495057;
    font-size: 0.95rem;
}

.subscription-details i {
    min-width: 25px;
    font-size: 1.1rem;
}

.subscription-details strong {
    color: #343a40;
    margin-left: 5px;
}

/* Progress Bar للوجبات */
.progress {
    height: 25px;
    border-radius: 8px;
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    transition: width 0.6s ease;
}

/* Footer البطاقة */
.active-subscription-card .card-footer {
    background: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
}

/* Empty State - حالة عدم وجود اشتراكات */
.empty-state {
    padding: 60px 20px;
}

    .empty-state i {
        opacity: 0.6;
        animation: pulse 2s ease-in-out infinite;
    }

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Section Header */
.section-header {
    margin-bottom: 40px;
}

    .section-header h2 {
        font-size: 2rem;
        font-weight: 700;
        color: #343a40;
    }

    .section-header p {
        color: #6c757d;
        font-size: 1.1rem;
    }

/* ====================================
   Mobile Optimizations
==================================== */

@media (max-width: 768px) {
    /* بطاقة الاشتراك */
    .active-subscription-card .card-header {
        padding: 15px;
    }

        .active-subscription-card .card-header h3 {
            font-size: 1.1rem;
        }

    .active-subscription-card .card-body {
        padding: 15px;
    }

    /* التفاصيل */
    .subscription-details p {
        font-size: 0.9rem;
    }

    .subscription-details i {
        min-width: 20px;
        font-size: 1rem;
    }

    /* Progress Bar */
    .progress {
        height: 20px !important;
    }

    .progress-bar {
        font-size: 0.75rem;
    }

    /* Section Header */
    .section-header h2 {
        font-size: 1.5rem;
    }

    .section-header p {
        font-size: 1rem;
    }

    /* Detail Item */
    .detail-item {
        padding: 12px !important;
        margin-bottom: 15px !important;
    }

    /* Empty State */
    .empty-state {
        padding: 40px 15px;
    }

        .empty-state i {
            font-size: 3rem !important;
        }

        .empty-state h3 {
            font-size: 1.3rem;
        }
}

@media (max-width: 576px) {
    .active-subscription-card .card-header h3 {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.3rem;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* ====================================
   RTL Support
==================================== */

[dir="rtl"] .detail-item {
    border-left: none;
    border-right: 4px solid #ffc107;
}

[dir="rtl"] .subscription-details i {
    margin-left: 0;
    margin-right: 10px;
}

/* ====================================
   Animation Effects
==================================== */

.active-subscription-card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effect for Buttons */
.active-subscription-card .btn {
    transition: all 0.3s ease;
}

    .active-subscription-card .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

/* Badge Styles */
.badge {
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
}

/* Card Footer Button */
.card-footer .btn-outline-primary {
    border-width: 2px;
    font-weight: 600;
}

    .card-footer .btn-outline-primary:hover {
        background: #007bff;
        color: white;
        transform: translateY(-2px);
    }

/* Progress Bar Colors */
.progress-bar.bg-success {
    background: linear-gradient(90deg, #28a745, #20c997) !important;
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, #ffc107, #ffda6a) !important;
    color: #000 !important;
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, #dc3545, #c82333) !important;
}

/* Text Truncate للعناوين الطويلة */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}