/* Codes Page Specific Styles */

/* Codes Hero Section */
.codes-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 120px 0 80px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.codes-hero::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"><text y="50" font-size="40">🎁</text></svg>') repeat;
    opacity: 0.1;
    animation: float 25s infinite linear;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.live-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.live-dot {
    width: 10px;
    height: 10px;
    background: #2ecc71;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

/* Codes Stats Section */
.codes-stats {
    padding: 3rem 0;
    background: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    background: var(--bg-alt);
    border-radius: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-weight: 600;
}

/* Main Content */
.codes-main {
    padding: 4rem 0;
    background: var(--bg-alt);
}

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

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* Codes Grid */
.codes-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 4rem;
}

.code-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}

.code-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.code-card.featured {
    border: 3px solid #ffd700;
    background: linear-gradient(135deg, #fff9e6, #ffffff);
}

.code-card.premium {
    border: 3px solid #c0c0c0;
    background: linear-gradient(135deg, #f8f8f8, #ffffff);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-color);
}

.code-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
}

.premium-badge {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #333;
}

.exclusive-badge {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.limited-badge {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    animation: pulse 2s infinite;
}

.code-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.code-status.active {
    background: #d4edda;
    color: #155724;
}

.code-status.expired {
    background: #f8d7da;
    color: #721c24;
}

.code-content {
    padding: 1.5rem;
}

.code-text {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
    text-align: center;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: 8px;
    letter-spacing: 2px;
}

.code-reward {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.reward-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.reward-details {
    flex: 1;
}

.reward-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.reward-secondary {
    color: var(--text-light);
    font-size: 0.875rem;
}

.code-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-light);
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.expiry-date {
    font-weight: 600;
}

.uses-remaining {
    color: var(--primary-color);
    font-weight: 600;
}

.code-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-alt);
    border-top: 1px solid var(--border-color);
}

.code-actions .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
}

/* Expired Codes Section */
.expired-codes {
    margin-bottom: 4rem;
}

.toggle-expired {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.toggle-expired:hover {
    background: var(--secondary-color);
}

.expired-cards-grid.hidden {
    display: none;
}

.expired-cards-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.code-card.expired {
    opacity: 0.7;
    background: #f8f9fa;
}

.code-card.expired:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* How to Redeem Section */
.how-to-redeem {
    background: white;
    padding: 4rem 0;
    margin-bottom: 4rem;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.step-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 2rem;
    background: var(--bg-alt);
    border-radius: 12px;
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--text-light);
    line-height: 1.5;
}

/* FAQ Section */
.codes-faq {
    margin-bottom: 4rem;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--bg-alt);
}

.faq-question h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark-color);
}

.faq-toggle {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 1.5rem;
    max-height: 200px;
}

.faq-answer p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Notification CTA */
.notification-cta {
    background: linear-gradient(135deg, var(--dark-color), var(--primary-color));
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn-primary {
    background: var(--accent-color);
    color: white;
}

.cta-buttons .btn-primary:hover {
    background: #c0392b;
}

.cta-buttons .btn-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.cta-buttons .btn-outline:hover {
    background: white;
    color: var(--dark-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--dark-color);
}

.modal-body {
    padding: 2rem;
    text-align: center;
}

.modal-body p {
    color: var(--text-light);
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .codes-hero h1 {
        font-size: 2rem;
    }

    .codes-hero p {
        font-size: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .filter-buttons {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.875rem;
    }

    .code-text {
        font-size: 1.25rem;
    }

    .code-actions {
        flex-direction: column;
    }

    .steps-container {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .stat-number {
        font-size: 2rem;
    }

    .code-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .code-reward {
        flex-direction: column;
        text-align: center;
    }

    .code-meta {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .step-card {
        padding: 1.5rem;
    }

    .faq-question {
        padding: 1rem;
    }

    .faq-question h3 {
        font-size: 1rem;
    }
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-alt);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Copy animation */
.code-copied {
    animation: copyPulse 0.6s ease;
}

@keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background: #d4edda; }
    100% { transform: scale(1); }
}

/* No Results Message */
.no-codes {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 12px;
    margin: 2rem 0;
}

.no-codes h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.no-codes p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Print styles */
@media print {
    .codes-hero,
    .notification-cta,
    .footer {
        display: none;
    }

    .codes-main {
        background: white;
    }

    .code-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}