:root {
    --bg-black: #0b0e14;
    --card-dark: #161a21;
    --accent-blue: #00a3ff;
    --primary: #4BA000;
    --text-white: #ffffff;
    --text-gray: #9ca3af;
    --border-glass: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0b0e14 0%, #1a1f2e 100%);
    color: var(--text-white);
    font-family: 'Poppins', 'Cairo', sans-serif;
    margin: 0;
    padding: 40px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0,163,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(75,160,0,0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* شريط البحث العلوي المحسّن */
.header-wrapper { 
    max-width: 1300px; 
    margin: 0 auto 30px;
    position: relative;
    z-index: 100;
}

.topbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 20px;
    background: rgba(22, 26, 33, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 15px 25px;
    border-radius: 20px;
    border: 2px solid rgba(0,163,255,0.3);
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.search-group-container {
    flex: 1;
    max-width: 900px;
    margin-right: 20px;
}

.search-group {
    background: linear-gradient(135deg, rgba(0,163,255,0.15) 0%, rgba(15,23,42,0.8) 100%);
    border: 2px solid var(--accent-blue);
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 8px 10px 8px 25px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 0 30px rgba(0,163,255,0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-group::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,163,255,0.1) 0%, transparent 70%);
    animation: rotate 15s linear infinite;
}

.search-group:focus-within {
    box-shadow: 0 0 40px rgba(0,163,255,0.6);
    transform: scale(1.02);
    border-color: #00d4ff;
}

.search-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.search-item span {
    font-size: 20px;
    filter: drop-shadow(0 0 8px var(--accent-blue));
}

.search-item input {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    width: 100%;
    outline: none;
    font-weight: 500;
}

.search-item input::placeholder {
    color: #64748b;
}

.divider { 
    width: 2px; 
    height: 30px;
    background: linear-gradient(180deg, transparent, rgba(0,163,255,0.5), transparent);
    margin: 0 20px;
}

/* أزرار اللغات المحسّنة */
.right-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.langs {
    display: flex;
    gap: 8px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lang-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0,163,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.lang-btn:hover::before {
    width: 200px;
    height: 200px;
}

.lang-btn:hover {
    background: rgba(0,163,255,0.2);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #0082cc 100%);
    box-shadow: 0 5px 20px rgba(0,163,255,0.5);
    border-color: transparent;
}

.home-btn {
    font-size: 1.3rem;
    line-height: 1;
    padding: 10px 18px;
}

.home-btn:hover {
    transform: scale(1.1) rotate(5deg);
}

/* التخطيط الرئيسي */
.main-layout {
    display: grid; 
    grid-template-columns: 1fr;
    gap: 30px; 
    max-width: 1800px; 
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.section-title { 
    font-size: 18px; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    margin-bottom: 30px; 
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    border-radius: 2px;
}

.container {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 30px;
    padding: 20px;
}

/* تصميم الكارت الخارق */
.store-card {
    background: linear-gradient(135deg, rgba(0,163,255,0.1) 0%, rgba(22,26,33,0.9) 100%);
    border-radius: 20px; 
    overflow: hidden;
    text-decoration: none; 
    color: inherit;
    border: 2px solid transparent;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: cardFadeIn 0.6s ease forwards;
    opacity: 0;
}

.store-card:nth-child(1) { animation-delay: 0.1s; }
.store-card:nth-child(2) { animation-delay: 0.15s; }
.store-card:nth-child(3) { animation-delay: 0.2s; }
.store-card:nth-child(4) { animation-delay: 0.25s; }
.store-card:nth-child(5) { animation-delay: 0.3s; }
.store-card:nth-child(6) { animation-delay: 0.35s; }
.store-card:nth-child(7) { animation-delay: 0.4s; }
.store-card:nth-child(8) { animation-delay: 0.45s; }

.store-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, var(--accent-blue), var(--primary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.store-card:hover::before {
    opacity: 1;
}

.store-card:hover { 
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0,163,255,0.4);
}

.card-image { 
    position: relative; 
    height: 200px;
    overflow: hidden;
}

.store-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
    transition: transform 0.5s ease;
}

.store-card:hover .store-img {
    transform: scale(1.1);
}

.store-img.placeholder { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 50px; 
    background: linear-gradient(135deg, #1a1f2e 0%, #0b0e14 100%);
}

.badge {
    position: absolute; 
    top: 15px; 
    left: 15px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #0082cc 100%);
    padding: 6px 14px;
    border-radius: 8px; 
    font-size: 12px; 
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,163,255,0.4);
    z-index: 2;
}

.card-body { 
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-body h3 { 
    margin: 0 0 10px; 
    font-size: 18px;
    font-weight: 600;
}

.rating-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.stars { 
    color: #fbbf24; 
    font-size: 14px;
}

.rating-num {
    font-size: 13px;
    color: var(--text-gray);
}

.store-desc {
    font-size: 14px; 
    color: var(--text-gray);
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden; 
    margin: 10px 0;
    line-height: 1.6;
    flex-grow: 1;
}

.views-badge {
    display: flex; 
    justify-content: space-between;
    align-items: center;
    font-size: 12px; 
    color: var(--accent-blue); 
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

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

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

/* ===============================
    📱 تصميم الهاتف (Mobile)
   =============================== */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .main-layout {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 20px;
    }

    .header-wrapper {
        margin-bottom: 20px;
    }

    .topbar {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 20px;
    }

    .search-group-container {
        max-width: 100%;
        margin-right: 0;
        width: 100%;
    }

    .search-group {
        flex-direction: column;
        padding: 15px;
        border-radius: 20px;
        gap: 10px;
    }

    .divider {
        display: none;
    }

    .search-item {
        width: 100%;
    }

    .right-actions {
        width: 100%;
        justify-content: center;
    }

    .card-image {
        height: 180px;
    }

    .section-title {
        font-size: 16px;
    }

    .store-card {
        animation-delay: 0s !important;
    }
}


/* Action Buttons */
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.action-btn:hover::before {
    left: 100%;
}

.btn-details {
    background: linear-gradient(135deg, #00a3ff, #0077cc);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 163, 255, 0.3);
}

.btn-details:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 163, 255, 0.5);
}

.btn-products {
    background: linear-gradient(135deg, #4BA000, #3d8000);
    color: white;
    box-shadow: 0 4px 15px rgba(75, 160, 0, 0.3);
}

.btn-products:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(75, 160, 0, 0.5);
}

.action-btn i {
    font-size: 18px;
    font-style: normal;
}

/* Responsive للأزرار */
@media (max-width: 768px) {
    .card-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}

/* Fix long URLs and text overflow in store cards */
.store-card * {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.store-card h3 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.store-desc {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

/* Fix long URLs in store details page */
a {
    word-break: break-all;
    overflow-wrap: anywhere;
}
