/* Custom styles for CashbackMax - Cloudflare Pages Demo */

:root {
    --bg-primary: #08090d;
    --bg-secondary: #0f111a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --shopee-color: #ff5722;
    --tiktok-color: #fe2c55;
    
    --gradient-primary: linear-gradient(135deg, #ff5722 0%, #fe2c55 50%, #00f2fe 100%);
    --gradient-shopee: linear-gradient(135deg, #ff8a00 0%, #ff5722 100%);
    --gradient-tiktok: linear-gradient(135deg, #111111 0%, #fe2c55 100%);
    --gradient-glow: linear-gradient(135deg, rgba(255, 87, 34, 0.15) 0%, rgba(254, 44, 85, 0.15) 100%);
    
    --glass-bg: rgba(15, 17, 26, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    
    --success: #10b981;
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Background Glow Effect */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-1 {
    position: absolute;
    top: -20%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 87, 34, 0.2) 0%, transparent 70%);
    filter: blur(80px);
    animation: floatGlow 12s infinite alternate;
}

.glow-2 {
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(254, 44, 85, 0.15) 0%, transparent 70%);
    filter: blur(80px);
    animation: floatGlow 15s infinite alternate-reverse;
}

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

/* Reusable Glassmorphism Class */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--glass-highlight) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Typography Utilities */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.highlight {
    color: var(--shopee-color);
}

.text-center { text-align: center; }
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Buttons */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(254, 44, 85, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(254, 44, 85, 0.5);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-block {
    display: width;
    width: 100%;
}

/* Navigation Header */
.navbar {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 9, 13, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-icon {
    font-size: 24px;
    animation: rotateLogo 6s infinite linear;
}

@keyframes rotateLogo {
    0%, 80%, 100% { transform: rotate(0deg); }
    85% { transform: rotate(15deg); }
    90% { transform: rotate(-15deg); }
    95% { transform: rotate(10deg); }
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 6px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 50px;
}

/* Main Layout */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px 80px 24px;
}

/* Hero Section */
.hero-section {
    padding: 40px 0;
    text-align: center;
}

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

.badge-container {
    margin-bottom: 24px;
    display: inline-block;
}

.promo-badge {
    background: var(--gradient-glow);
    border: 1px solid rgba(254, 44, 85, 0.3);
    color: #ffd0d8;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 0 15px rgba(254, 44, 85, 0.1);
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1.5px;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* Form Styling */
.cashback-card {
    padding: 32px;
    max-width: 650px;
    margin: 0 auto 40px auto;
}

.cashback-form {
    display: flex;
    gap: 12px;
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    font-size: 18px;
    pointer-events: none;
}

.cashback-form input[type="url"] {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

.cashback-form input[type="url"]:focus {
    outline: none;
    border-color: var(--tiktok-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(254, 44, 85, 0.15);
}

.form-footer {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    gap: 12px;
    flex-wrap: wrap;
}

.user-ip-display {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    color: #00f2fe;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ip-loading {
    color: var(--text-secondary);
    animation: pulseText 1.5s infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Platform Showcase */
.platforms {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.platforms-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

.platforms-list {
    display: flex;
    gap: 20px;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
}

.platform-item.shopee {
    border-color: rgba(255, 87, 34, 0.2);
    color: #ff8a65;
}

.platform-item.tiktok {
    border-color: rgba(254, 44, 85, 0.2);
    color: #ff80ab;
}

/* Sections Global */
section {
    padding: 80px 0 20px 0;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 48px auto;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Live Activity Feed */
.feed-container {
    max-width: 650px;
    margin: 0 auto;
    padding: 24px;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0px rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0px rgba(16, 185, 129, 0); }
}

.status-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

.users-counter {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: hidden;
    position: relative;
}

.feed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-md);
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transition: var(--transition);
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

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

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
}

.feed-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.platform-badge {
    font-size: 11px;
    color: var(--text-secondary);
}

.feed-value {
    text-align: right;
}

.cashback-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--success);
}

.cashback-rate {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.step-card {
    padding: 32px;
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px -15px rgba(0, 0, 0, 0.6);
}

.step-num {
    font-size: 14px;
    font-weight: 800;
    color: var(--shopee-color);
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.step-icon {
    font-size: 36px;
    margin-bottom: 24px;
}

.step-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.step-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* FAQ Accordion */
.faq-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    border-radius: var(--border-radius-md) !important;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.02);
}

.faq-toggle {
    font-size: 20px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
    background: rgba(0, 0, 0, 0.1);
}

.faq-answer p {
    padding: 0 24px 20px 24px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    transition: max-height 0.3s cubic-bezier(1, 0, 1, 0);
}

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

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(4, 5, 8, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: var(--transition);
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    padding: 40px 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

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

.celebrate-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.modal-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
}

.modal-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.result-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.result-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.result-value {
    font-size: 40px;
    font-weight: 800;
    color: var(--success);
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.product-info-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
    margin-bottom: 24px;
    text-align: left;
}

.product-url-preview {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.product-status {
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    color: var(--success);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-notice {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Animations loading inside form */
.btn-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

.hidden {
    display: none !important;
}

.animate-scale {
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Footer Section */
.footer {
    width: 100%;
    border-top: 1px solid var(--glass-border);
    padding: 40px 24px;
    background: rgba(8, 9, 13, 0.9);
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-meta {
    display: flex;
    gap: 16px;
}

.cloudflare-power {
    font-size: 13px;
    color: var(--text-secondary);
}

.cloudflare-power a {
    color: #f38020;
    text-decoration: none;
    font-weight: 600;
}

.cloudflare-power a:hover {
    text-decoration: underline;
}

/* Responsive styles */
@media (max-width: 992px) {
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 16px;
    }
    .nav-menu {
        display: none; /* simple hidden layout for education study */
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .cashback-card {
        padding: 20px;
    }
    
    .cashback-form {
        flex-direction: column;
    }
    
    .btn-primary {
        width: 100%;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}
