/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --primary-dark: #e55a2b;
    --secondary-color: #2c3e50;
    --accent-color: #f39c12;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --background-color: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(255, 107, 53, 0.3);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    direction: ltr;
}

body[dir="rtl"] {
    font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    direction: rtl;
}

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

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 8px;
    background: var(--white);
    padding: 8px;
    border-radius: 25px;
    box-shadow: var(--shadow);
}

body[dir="rtl"] .language-switcher {
    right: auto;
    left: 20px;
}

.lang-btn {
    background: transparent;
    border: 2px solid transparent;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 14px;
}

.lang-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.lang-btn:hover:not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    padding: 60px 0 40px;
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo-image {
    flex-shrink: 0;
}

.logo-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.logo-text {
    text-align: center;
}

.logo h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.tagline {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
}



/* Main Content */
.main-content {
    padding: 0 0 60px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 40px;
    color: var(--secondary-color);
}

/* Coupons Grid */
.coupons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Coupon Card */
.coupon-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.coupon-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.coupon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.coupon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.store-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-logo {
    width: 70px;
    height: 70px;
    border-radius: 7px;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
    overflow: hidden;
}

.store-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

.store-logo:not(:has(img)) {
    /* Fallback for emoji icons */
    font-size: 1.5rem;
    color: var(--primary-color);
}

.store-details h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.store-details p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.discount-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    min-width: 80px;
}

.coupon-content {
    margin-bottom: 20px;
}

.coupon-description {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 15px;
    line-height: 1.5;
}

.coupon-code-section {
    background: var(--background-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px dashed var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.coupon-code-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
    display: block;
}

.coupon-code {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--white);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--primary-color);
    display: inline-block;
    margin-right: 10px;
    flex: 1;
    min-width: 120px;
}

body[dir="rtl"] .coupon-code {
    margin-right: 0;
    margin-left: 10px;
}

.copy-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.coupon-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.timer {
    background: var(--accent-color);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.store-link {
    background: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-block;
}

.store-link:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 60px;
}

    .footer-content {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 40px;
        margin-bottom: 30px;
    }
    
    .social-links {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .social-link {
        padding: 10px 14px;
    }

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.social-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

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

.social-link:hover::before {
    left: 100%;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.social-link:active {
    transform: translateY(0);
}

.social-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.social-link:hover .social-icon {
    transform: scale(1.1);
}

/* Social Media Brand Colors */
.social-link.tiktok:hover {
    background: linear-gradient(135deg, #ff0050, #00f2ea);
    border-color: #ff0050;
}

.social-link.twitter:hover {
    background: linear-gradient(135deg, #1da1f2, #0d8bd9);
    border-color: #1da1f2;
}

.social-link.instagram:hover {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    border-color: #dc2743;
}

.social-link.facebook:hover {
    background: linear-gradient(135deg, #1877f2, #0d6efd);
    border-color: #1877f2;
}

/* RTL adjustments */
body[dir="rtl"] .social-link:hover {
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.disclaimer-text {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 8px;
    color: var(--text-light);
    font-style: italic;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: var(--white);
    padding: 15px 25px;
    border-radius: 25px;
    box-shadow: var(--shadow);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 40px 0 30px;
    }
    
    .logo {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo-img {
        width: 100px;
        height: 100px;
    }
    
    .store-logo {
        width: 60px;
        height: 60px;
    }
    
    .logo h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .coupons-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .coupon-card {
        padding: 20px;
    }
    
    .coupon-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .coupon-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .store-link {
        text-align: center;
    }
    
    .language-switcher {
        top: 15px;
        right: 15px;
    }
    
    body[dir="rtl"] .language-switcher {
        right: auto;
        left: 15px;
    }
}

@media (max-width: 480px) {
    .logo {
        gap: 10px;
    }
    
    .logo-img {
        width: 80px;
        height: 80px;
    }
    
    .store-logo {
        width: 55px;
        height: 55px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .coupon-card {
        padding: 15px;
    }
    
    .coupon-code {
        font-size: 1rem;
        padding: 6px 10px;
    }
}

/* RTL Specific Adjustments */
body[dir="rtl"] .coupon-header {
    flex-direction: row-reverse;
}

body[dir="rtl"] .coupon-footer {
    flex-direction: row-reverse;
}

body[dir="rtl"] .social-link {
    flex-direction: row-reverse;
}

/* RTL Coupon Card Layout */
body[dir="rtl"] .coupon-card {
    direction: rtl;
}

/* RTL specific text alignment */
body[dir="rtl"] .coupon-description {
    text-align: right;
}

body[dir="rtl"] .coupon-code-label {
    text-align: right;
}

/* RTL Coupon Card Specific Layout */
body[dir="rtl"] .store-info {
    flex-direction: row-reverse;
}

body[dir="rtl"] .store-details {
    text-align: right;
}

body[dir="rtl"] .coupon-code-section {
    text-align: right;
}

body[dir="rtl"] .coupon-code {
    margin-right: 0;
    margin-left: 10px;
}

body[dir="rtl"] .copy-btn {
    order: -1;
}

body[dir="rtl"] .timer {
    text-align: right;
}

/* Animation for coupon cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

.coupon-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* Hover effects for interactive elements */
.copy-btn:active {
    transform: scale(0.95);
}

.store-link:active {
    transform: translateY(0);
}

/* Focus styles for accessibility */
.copy-btn:focus,
.store-link:focus,
.lang-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading state for coupons */
.coupon-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.coupon-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

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