/* ===================================
   MaGiamGia - Design System
   Premium Coupon Website
   =================================== */

/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* === CSS Variables === */
:root {
    /* Primary */
    --primary: #FF6B35;
    --primary-light: #FF8E53;
    --primary-dark: #E55A2B;
    --primary-50: rgba(255, 107, 53, 0.08);
    --primary-100: rgba(255, 107, 53, 0.15);

    /* Secondary */
    --secondary: #1A1A2E;
    --secondary-light: #2D2D44;

    /* Platform Colors */
    --shopee: #EE4D2D;
    --shopee-light: #FF6842;
    --shopee-bg: rgba(238, 77, 45, 0.08);
    --lazada: #0F146D;
    --lazada-light: #1A1F8F;
    --lazada-bg: rgba(15, 20, 109, 0.08);
    --tiki: #1A94FF;
    --tiki-light: #3DA5FF;
    --tiki-bg: rgba(26, 148, 255, 0.08);

    /* Status */
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.1);

    /* Surfaces */
    --background: #F0F4F8;
    --surface: #FFFFFF;
    --surface-hover: #F8FAFC;
    --surface-glass: rgba(255, 255, 255, 0.75);
    --border: #E2E8F0;
    --border-light: #F1F5F9;

    /* Text */
    --text: #1E293B;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-inverse: #FFFFFF;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #FF6B35 0%, #FF8E53 100%);
    --gradient-hero: linear-gradient(135deg, #FF6B35 0%, #FF4E50 50%, #F9D423 100%);
    --gradient-dark: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%);
    --gradient-shopee: linear-gradient(135deg, #EE4D2D 0%, #FF6842 100%);
    --gradient-lazada: linear-gradient(135deg, #0F146D 0%, #1A1F8F 100%);
    --gradient-tiki: linear-gradient(135deg, #1A94FF 0%, #3DA5FF 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-primary: 0 4px 14px rgba(255, 107, 53, 0.35);

    /* Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 100px;

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --max-width: 1280px;
    --header-height: 68px;
}

/* === Reset === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style: none;
}

/* === Layout === */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.page-content {
    min-height: calc(100vh - var(--header-height) - 300px);
    padding-top: calc(var(--header-height) + 20px);
}

/* === Grid === */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .grid-3,
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .grid-2,
    .grid-3,
    .grid-4 { grid-template-columns: 1fr; }
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .emoji {
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary-50);
    border-radius: var(--radius-sm);
}

.section-title .view-all {
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-title .view-all:hover {
    color: var(--primary-dark);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-ghost {
    background: var(--primary-50);
    color: var(--primary);
}

.btn-ghost:hover {
    background: var(--primary-100);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-shopee {
    background: var(--shopee-bg);
    color: var(--shopee);
}

.badge-lazada {
    background: var(--lazada-bg);
    color: var(--lazada);
}

.badge-tiki {
    background: var(--tiki-bg);
    color: var(--tiki);
}

.badge-hot {
    background: var(--danger-bg);
    color: var(--danger);
}

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

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

.badge-expiring {
    background: var(--warning-bg);
    color: var(--warning);
    animation: pulse-badge 2s infinite;
}

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

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === Cards (Glass) === */
.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-slow);
}

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

.card-glass {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* === Platform Tabs === */
.platform-tabs {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: var(--surface);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.platform-tab {
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    color: var(--text-secondary);
}

.platform-tab:hover {
    background: var(--surface-hover);
}

.platform-tab.active-shopee {
    background: var(--gradient-shopee);
    color: white;
}

.platform-tab.active-lazada {
    background: var(--gradient-lazada);
    color: white;
}

.platform-tab.active-tiki {
    background: var(--gradient-tiki);
    color: white;
}

/* === Toast Notification === */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--secondary);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

/* === Skeleton Loading === */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === Form === */
.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* === Utilities === */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none; }

/* === Section Spacing === */
.section {
    padding: 40px 0;
}

.section + .section {
    padding-top: 0;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.4s ease forwards;
}

/* === Responsive === */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .container {
        padding: 0 16px;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .section {
        padding: 28px 0;
    }

    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}
