/* ========== إعدادات عامة ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    direction: rtl;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== Header ========== */
.site-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.site-header.scrolled {
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.header-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo-icon {
    font-size: 3rem;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.site-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin: 0;
}

.site-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-item {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-item i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ========== Main Content ========== */
.main-content {
    padding: 3rem 0;
    min-height: 60vh;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-header h2 i {
    color: #e74c3c;
}

.section-header p {
    color: #7f8c8d;
    font-size: 1rem;
}

/* ========== Coupons Grid ========== */
.coupons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.coupon-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #f0f0f0;
}

.coupon-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.coupon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    background-size: 300% 300%;
    animation: gradient 3s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========== Coupon Card Header ========== */
.coupon-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px dashed #e0e0e0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.store-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.store-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 12px;
    background: #f8f9fa;
    padding: 8px;
    border: 2px solid #e9ecef;
}

.logo-fallback {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.store-details h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.coupon-type {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.discount-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(255,107,107,0.3);
}

/* ========== Coupon Card Body ========== */
.coupon-body {
    padding: 1.5rem;
}

.coupon-description {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    min-height: 3rem;
}

.promo-code-section {
    margin-bottom: 1rem;
}

.promo-code-container {
    background: linear-gradient(135deg, #fff5f5, #ffe8e8);
    border: 2px dashed #ff6b6b;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.promo-code {
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: #c0392b;
    letter-spacing: 1px;
    user-select: all;
    flex: 1;
}

.copy-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f4e79);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52,152,219,0.3);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.copy-btn i {
    font-size: 0.9rem;
}

/* ========== Coupon Card Footer ========== */
.coupon-footer {
    background: #f8f9fa;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.activate-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(231,76,60,0.3);
}

.activate-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231,76,60,0.4);
}

.expiry-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.expiry-info i {
    color: #bdc3c7;
}

/* ========== Popular Stores Section ========== */
.popular-stores-section {
    margin-top: 4rem;
    padding: 2rem 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.popular-stores-section h2 {
    text-align: center;
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.popular-stores-section h2 i {
    color: #f39c12;
}

.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
    padding: 0 2rem;
}

.store-item {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.store-item:hover::before {
    left: 100%;
}

.store-item:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102,126,234,0.2);
}

.store-item img,
.store-fallback {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border-radius: 10px;
    object-fit: contain;
}

.store-fallback {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.store-item .store-name {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.store-item .coupon-count {
    display: block;
    color: #7f8c8d;
    font-size: 0.8rem;
}

/* ========== Error & Empty States ========== */
.error-message,
.no-coupons {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.error-message i,
.no-coupons i {
    font-size: 4rem;
    color: #e74c3c;
    margin-bottom: 1rem;
    display: block;
}

.error-message h2,
.no-coupons h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.error-message p,
.no-coupons p {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.retry-btn,
.refresh-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.retry-btn:hover,
.refresh-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f4e79);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52,152,219,0.3);
}

/* ========== Footer ========== */
.site-footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: #ecf0f1;
}

.footer-section p {
    color: #bdc3c7;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #3498db;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 1rem;
    text-align: center;
    color: #95a5a6;
    font-size: 0.9rem;
}

.powered-by a {
    color: #3498db;
    text-decoration: none;
}

.powered-by a:hover {
    text-decoration: underline;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .site-header h1 {
        font-size: 2rem;
    }
    
    .site-description {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .coupons-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .coupon-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .store-info {
        justify-content: center;
    }
    
    .coupon-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .promo-code-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stores-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 1.5rem 0;
    }
    
    .site-header h1 {
        font-size: 1.8rem;
    }
    
    .logo-section {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo-icon {
        font-size: 2.5rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .popular-stores-section {
        margin: 2rem 0;
        padding: 1.5rem 0;
    }
    
    .stores-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        padding: 0 0.5rem;
    }
}

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

.coupon-card {
    animation: fadeInUp 0.6s ease forwards;
}

.coupon-card:nth-child(even) {
    animation-delay: 0.1s;
}

.coupon-card:nth-child(3n) {
    animation-delay: 0.2s;
}

/* ========== Print Styles ========== */
@media print {
    .site-header,
    .site-footer,
    .popular-stores-section {
        display: none;
    }
    
    .coupon-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .activate-btn {
        background: #333 !important;
    }
}
