/* ==========================================================================
   assets/core.css - Design Tokens & Shared Primitives
   Shared across Public Pages and Admin Dashboard (DRY Principle)
   Design: Dark Luxury Glassmorphism (#0b0d10, #FFDF73, #E5A93C)
   ========================================================================== */

/* 1. LOCAL FONTS SETUP */
@font-face {
    font-family: 'Outfit';
    src: url('fonts/Outfit-Variable.woff2') format('woff2-variations'),
        url('fonts/Outfit-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Space Grotesk';
    src: url('fonts/SpaceGrotesk-Variable.woff2') format('woff2-variations'),
        url('fonts/SpaceGrotesk-Variable.woff2') format('woff2');
    font-weight: 300 700;
    font-display: swap;
    font-style: normal;
}

/* 2. DESIGN TOKENS (:ROOT) */
:root {
    --bg-color: #0b0d10;
    --card-bg: rgba(22, 26, 32, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --gold-gradient: linear-gradient(135deg, #FFDF73 0%, #E5A93C 50%, #FFDF73 100%);
    --gold-glow: rgba(229, 169, 60, 0.25);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --success: #10b981;

    /* Glass Refinements */
    --glass-highlight: rgba(255, 255, 255, 0.1);
    --accent-color: #E5A93C;
    --danger-color: #ef4444;
}

/* 3. BASE NORMALIZATION & TYPOGRAPHY */
html {
    overflow-y: scroll;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Roboto', 'Arial', 'Helvetica', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    background: var(--bg-color);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(229, 169, 60, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(30, 41, 59, 0.2) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    margin: 0;
    display: block;
    position: relative;
}

/* Headings */
h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 10px rgba(229, 169, 60, 0.2));
    text-transform: uppercase;
}

h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    color: #fff;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

/* 4. MODERN GRID & AMBIENT BLOBS */
.website-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: linear-gradient(rgb(255 255 255 / 2%) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100px 100px;
    mask-image: radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0.3) 0%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0.3) 0%, black 40%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

body::before,
body::after {
    content: "";
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

body::before {
    background: #E5A93C;
    top: -100px;
    right: -100px;
    animation: blobFloat 20s infinite alternate;
    z-index: -2;
}

body::after {
    background: #3b82f6;
    bottom: -100px;
    left: -100px;
    animation: blobFloat 25s infinite alternate-reverse;
    z-index: -2;
}

@keyframes blobFloat {
    from {
        transform: translate(0, 0) scale(1);
    }
    to {
        transform: translate(-100px, 50px) scale(1.1);
    }
}

/* 5. GLASS CARDS & FADE-IN */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.8s ease-out;
}

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

/* 6. COMMON BUTTONS */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #111;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.btn-primary {
    background: var(--gold-gradient);
    box-shadow: 0 5px 15px var(--gold-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(229, 169, 60, 0.5);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: none;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fff;
    transform: translateY(-2px);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: #fff;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 7. FORM INPUTS & CONTROLS */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    outline: none;
    transition: all 0.3s;
    font-size: 1rem;
}

.form-control:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(229, 169, 60, 0.1);
}

.login-box {
    max-width: 450px;
    margin: 0 auto;
}

.login-box h1 {
    text-align: center;
}

/* 8. SWITCH TOGGLE UI */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

input:checked+.slider {
    background-color: #10b981;
    border-color: #059669;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* 9. ALERTS, TOASTS & MODALS */
.alert {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-size: 0.9rem;
    text-align: center;
}

#toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

#toast.show {
    opacity: 1;
    pointer-events: auto;
    animation: fadeInUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 100001;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-content {
    width: 100%;
    max-width: 600px;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
}

/* 10. CODE DISPLAY & DESCRIPTIONS */
.hidden-code {
    font-family: 'Space Grotesk', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
    width: 100%;
}

.btn-copy-go {
    width: 100%;
    padding: 16px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    background: var(--gold-gradient);
    color: #111;
    box-shadow: 0 5px 15px var(--gold-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-copy-go:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(229, 169, 60, 0.5);
}

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

/* Rich Text Description Output */
.coupon-desc {
    font-size: 0.92rem;
    color: var(--text-dim);
    margin: 8px 0 5px;
    line-height: 1.7;
}

.coupon-desc strong {
    color: #e2e8f0;
    font-weight: 700;
}

.coupon-desc em {
    font-style: italic;
    color: #cbd5e1;
}

.coupon-desc u {
    text-decoration: underline;
}

.coupon-desc ul,
.coupon-desc ol {
    padding-left: 1.4em;
    margin: 4px 0;
}

.coupon-desc li {
    margin-bottom: 2px;
}

.coupon-desc a {
    color: #FFDF73;
    text-decoration: underline;
}

.coupon-desc p {
    margin: 0 0 4px;
}

/* 11. BADGES & BRAND ICONS */
.discount-badge,
.coupon-badge {
    background: rgba(229, 169, 60, 0.1);
    color: #E5A93C;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    display: inline-block;
    border: 1px solid rgba(229, 169, 60, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes pulse-red {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.brand-section {
    width: 100%;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-icon {
    width: 45px;
    height: 45px;
    background: var(--gold-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #111;
    font-size: 1.2rem;
    box-shadow: 0 10px 15px -3px var(--gold-glow);
}

.brand-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}
