/* ============================================================
   ADVANCED UI — 3D · GLITTER · SPACE · GLASSMORPHISM
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Space+Grotesk:wght@400;700&display=swap');

/* ── CSS VARIABLES ─────────────────────────────────────── */
:root {
    --violet:   #7c3aed;
    --purple:   #a855f7;
    --pink:     #ec4899;
    --lavender: #c084fc;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow-glow: 0 8px 32px rgba(168, 85, 247, 0.35);
    --text-light: rgba(255,255,255,0.92);
    --text-dim:   rgba(255,255,255,0.55);
}

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

/* ── BODY — DEEP SPACE BACKGROUND ──────────────────────── */
body {
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-light);
    background:
            radial-gradient(ellipse 80% 60% at 20% 10%,  #3b0764 0%,  transparent 60%),
            radial-gradient(ellipse 60% 50% at 80% 80%,  #1e1b4b 0%,  transparent 55%),
            radial-gradient(ellipse 70% 40% at 60% 30%,  #4c1d95 0%,  transparent 50%),
            #0a0014;
    position: relative;
}

/* ── STAR FIELD (layer 1 — tiny stars) ─────────────────── */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
            radial-gradient(1px 1px at 10%  15%, rgba(255,255,255,0.9) 0%, transparent 100%),
            radial-gradient(1px 1px at 25%  60%, rgba(255,255,255,0.7) 0%, transparent 100%),
            radial-gradient(1px 1px at 40%  30%, rgba(255,255,255,0.8) 0%, transparent 100%),
            radial-gradient(1px 1px at 55%  80%, rgba(255,255,255,0.6) 0%, transparent 100%),
            radial-gradient(1px 1px at 70%  20%, rgba(255,255,255,0.9) 0%, transparent 100%),
            radial-gradient(1px 1px at 85%  55%, rgba(255,255,255,0.7) 0%, transparent 100%),
            radial-gradient(1px 1px at 15%  90%, rgba(255,255,255,0.5) 0%, transparent 100%),
            radial-gradient(1px 1px at 90%  10%, rgba(255,255,255,0.8) 0%, transparent 100%),
            radial-gradient(1.5px 1.5px at 33% 45%, rgba(200,160,255,0.9) 0%, transparent 100%),
            radial-gradient(1.5px 1.5px at 65% 65%, rgba(160,200,255,0.9) 0%, transparent 100%),
            radial-gradient(1px 1px at 78%  40%, rgba(255,200,200,0.8) 0%, transparent 100%),
            radial-gradient(1px 1px at 48%  8%,  rgba(255,255,255,0.6) 0%, transparent 100%),
            radial-gradient(1px 1px at 5%   50%, rgba(255,255,255,0.5) 0%, transparent 100%),
            radial-gradient(1px 1px at 95%  70%, rgba(255,255,255,0.7) 0%, transparent 100%);
    background-size: 600px 600px;
    animation: starDrift 80s linear infinite;
    pointer-events: none;
    z-index: 0;
}

/* ── GLITTER LAYER (layer 2 — animated sparkles) ─────────── */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
            radial-gradient(circle, rgba(255,255,255,0.95) 0%, transparent 60%),
            radial-gradient(circle, rgba(192,132,252,0.9)  0%, transparent 60%),
            radial-gradient(circle, rgba(236,72,153,0.8)   0%, transparent 60%),
            radial-gradient(circle, rgba(255,255,255,0.85) 0%, transparent 60%),
            radial-gradient(circle, rgba(167,139,250,0.9)  0%, transparent 60%),
            radial-gradient(circle, rgba(255,255,255,0.95) 0%, transparent 60%),
            radial-gradient(circle, rgba(216,180,254,0.8)  0%, transparent 60%),
            radial-gradient(circle, rgba(255,255,255,0.9)  0%, transparent 60%);
    background-size:
            3px 3px, 2px 2px, 2px 2px, 3px 3px,
            2px 2px, 3px 3px, 2px 2px, 2px 2px;
    background-position:
            10%  20%, 30%  70%, 50%  15%, 70%  50%,
            15%  80%, 85%  25%, 60%  90%, 40%  40%;
    animation: glitterPulse 4s ease-in-out infinite alternate,
    glitterDrift  15s linear infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

/* ── NEBULA ORBS (decorative blobs) ────────────────────── */
.nebula-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 12s ease-in-out infinite alternate;
}
.nebula-orb-1 {
    width: 500px; height: 500px;
    top: -150px; left: -100px;
    background: radial-gradient(circle, rgba(124,58,237,0.4), transparent 70%);
    animation-delay: 0s;
}
.nebula-orb-2 {
    width: 400px; height: 400px;
    bottom: -100px; right: -80px;
    background: radial-gradient(circle, rgba(236,72,153,0.35), transparent 70%);
    animation-delay: -4s;
}
.nebula-orb-3 {
    width: 300px; height: 300px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(168,85,247,0.25), transparent 70%);
    animation-delay: -8s;
}

/* ── HEADER ─────────────────────────────────────────────── */
header {
    text-align: center;
    padding: 45px 30px 30px;
    position: relative;
    z-index: 10;
}

header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff 0%, #c084fc 40%, #ec4899 80%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: shimmerText 4s linear infinite;
    text-shadow: none;
    /* 3D lift effect via drop-shadow */
    filter: drop-shadow(0 0 20px rgba(192,132,252,0.6))
    drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

header p {
    color: var(--text-dim);
    font-size: 14px;
    margin-top: 6px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ── MAIN CONTAINER ─────────────────────────────────────── */
.container {
    width: 92%;
    max-width: 1250px;
    margin: 0 auto 60px;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 28px;
    position: relative;
    z-index: 10;
}

/* ── GLASS CARD ─────────────────────────────────────────── */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 28px;
    position: relative;
    overflow: hidden;
    box-shadow:
            0 4px 6px  rgba(0,0,0,0.3),
            0 20px 60px rgba(124,58,237,0.2),
            inset 0 1px 0 rgba(255,255,255,0.15),
            inset 0 -1px 0 rgba(255,255,255,0.05);
    transform: perspective(1000px) rotateX(0deg);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: fadeInUp 0.7s ease both;
}

/* Inner glass shine streak */
.card::before {
    content: "";
    position: absolute;
    top: 0; left: -60%;
    width: 50%; height: 100%;
    background: linear-gradient(
            105deg,
            transparent 40%,
            rgba(255,255,255,0.06) 50%,
            transparent 60%
    );
    animation: cardShine 6s ease-in-out infinite;
    pointer-events: none;
}

/* 3D hover tilt */
.card:hover {
    transform: perspective(1000px) rotateX(2deg) translateY(-6px);
    box-shadow:
            0 8px 12px  rgba(0,0,0,0.4),
            0 30px 80px rgba(168,85,247,0.35),
            inset 0 1px 0 rgba(255,255,255,0.2),
            inset 0 -1px 0 rgba(255,255,255,0.07);
}

.card:nth-child(2) { animation-delay: 0.15s; }
.card:nth-child(3) { animation-delay: 0.30s; }

/* ── CARD TITLE ─────────────────────────────────────────── */
.card h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 18px;
    color: #e9d5ff;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.card h2::before {
    content: "";
    display: inline-block;
    width: 4px; height: 20px;
    border-radius: 4px;
    background: linear-gradient(180deg, #c084fc, #ec4899);
    box-shadow: 0 0 8px rgba(192,132,252,0.8);
}

/* ── INPUTS & SELECTS ───────────────────────────────────── */
input, select {
    width: 100%;
    padding: 12px 14px;
    margin: 7px 0;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    color: #fff;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
}

input::placeholder { color: var(--text-dim); }

select option {
    background: #1e0a3c;
    color: #fff;
}

input:focus, select:focus {
    border-color: var(--purple);
    background: rgba(168,85,247,0.12);
    box-shadow:
            0 0 0 3px rgba(168,85,247,0.2),
            0 0 20px rgba(168,85,247,0.15),
            inset 0 1px 0 rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

/* ── BUTTON ─────────────────────────────────────────────── */
button {
    padding: 12px 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #9333ea 100%);
    box-shadow:
            0 4px 15px rgba(168,85,247,0.5),
            0 1px 0 rgba(255,255,255,0.2) inset;
    transform: perspective(500px) translateZ(0);
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

/* Glimmer sweep on button */
button::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 70%; height: 100%;
    background: linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,0.25),
            transparent
    );
    transition: left 0.5s ease;
}

button:hover::before { left: 130%; }

button:hover {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 50%, #7c3aed 100%);
    transform: perspective(500px) translateZ(8px) translateY(-3px) scale(1.03);
    box-shadow:
            0 8px 25px rgba(168,85,247,0.7),
            0 2px 0 rgba(255,255,255,0.25) inset;
}

button:active {
    transform: perspective(500px) translateZ(2px) translateY(0) scale(0.98);
    box-shadow: 0 2px 10px rgba(168,85,247,0.4);
}

/* ── CONTROLS ROW ───────────────────────────────────────── */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.controls input, .controls select {
    flex: 1;
    min-width: 120px;
    margin: 0;
}

/* ── TABLE ──────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
}

/* ── TABLE HEADER ───────────────────────────────────────── */
th {
    background: linear-gradient(135deg, rgba(168,85,247,0.6), rgba(124,58,237,0.5));
    color: #fff;
    padding: 13px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(192,132,252,0.4);
    backdrop-filter: blur(10px);
    position: relative;
}

th::after {
    content: "";
    position: absolute;
    bottom: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(192,132,252,0.8), transparent);
}

th:first-child { border-radius: 12px 0 0 12px; }
th:last-child  { border-radius: 0 12px 12px 0; }

/* ── TABLE CELLS ────────────────────────────────────────── */
td {
    padding: 11px 12px;
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    background: rgba(255,255,255,0.04);
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: all 0.25s ease;
}

td:first-child { border-radius: 10px 0 0 10px; border-left: 1px solid rgba(255,255,255,0.07); }
td:last-child  { border-radius: 0 10px 10px 0;  border-right: 1px solid rgba(255,255,255,0.07); }

/* ── ROW HOVER ──────────────────────────────────────────── */
tr:hover td {
    background: rgba(168,85,247,0.12);
    border-color: rgba(168,85,247,0.25);
    box-shadow: 0 0 20px rgba(168,85,247,0.1) inset;
    transform: scale(1.002);
    color: #fff;
}

/* ── EXPIRED ROW ────────────────────────────────────────── */
.expired td {
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: rgba(239,68,68,0.3) !important;
    color: #fca5a5 !important;
}

.expired td:first-child {
    border-left: 2px solid rgba(239,68,68,0.6) !important;
    box-shadow: -4px 0 12px rgba(239,68,68,0.2) inset;
}

/* ── ACTION BUTTONS IN TABLE ─────────────────────────────── */
.delete-btn {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 4px 12px rgba(239,68,68,0.4);
    padding: 7px 14px;
    font-size: 12px;
    border-radius: 8px;
}
.delete-btn:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 6px 18px rgba(239,68,68,0.6);
    transform: perspective(300px) translateZ(6px) translateY(-2px) scale(1.05);
}

.edit-btn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 12px rgba(245,158,11,0.4);
    padding: 7px 14px;
    font-size: 12px;
    border-radius: 8px;
}
.edit-btn:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 6px 18px rgba(245,158,11,0.6);
    transform: perspective(300px) translateZ(6px) translateY(-2px) scale(1.05);
}

/* ── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar              { width: 6px; }
::-webkit-scrollbar-track        { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb        { background: rgba(168,85,247,0.5); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover  { background: rgba(168,85,247,0.8); }

/* ── LABEL TEXT ─────────────────────────────────────────── */
label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 10px;
    display: block;
}

/* ── BADGE / STATUS CHIP ────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    backdrop-filter: blur(6px);
}
.badge-active {
    background: rgba(34,197,94,0.2);
    border: 1px solid rgba(34,197,94,0.4);
    color: #86efac;
}
.badge-expired {
    background: rgba(239,68,68,0.2);
    border: 1px solid rgba(239,68,68,0.4);
    color: #fca5a5;
}

/* ── KEYFRAMES ──────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: perspective(1000px) translateY(30px) rotateX(-4deg); }
    to   { opacity: 1; transform: perspective(1000px) translateY(0)    rotateX(0deg);  }
}

@keyframes starDrift {
    from { transform: translateY(0); }
    to   { transform: translateY(-200px); }
}

@keyframes glitterPulse {
    from { opacity: 0.4; }
    to   { opacity: 0.9; }
}

@keyframes glitterDrift {
    0%   { background-position: 10% 20%, 30% 70%, 50% 15%, 70% 50%, 15% 80%, 85% 25%, 60% 90%, 40% 40%; }
    25%  { background-position: 15% 35%, 45% 55%, 60% 25%, 75% 65%, 25% 70%, 80% 40%, 50% 80%, 35% 55%; }
    50%  { background-position: 20% 50%, 55% 40%, 70% 35%, 80% 80%, 35% 60%, 75% 55%, 40% 70%, 30% 70%; }
    75%  { background-position: 15% 65%, 40% 25%, 55% 50%, 65% 95%, 45% 50%, 70% 70%, 30% 60%, 25% 85%; }
    100% { background-position: 10% 20%, 30% 70%, 50% 15%, 70% 50%, 15% 80%, 85% 25%, 60% 90%, 40% 40%; }
}

@keyframes shimmerText {
    0%   { background-position: 0%   50%; }
    100% { background-position: 200% 50%; }
}

@keyframes cardShine {
    0%   { left: -60%; opacity: 0; }
    30%  { opacity: 1; }
    60%  { left: 130%; opacity: 0; }
    100% { left: 130%; opacity: 0; }
}

@keyframes orbFloat {
    from { transform: translate(0, 0)   scale(1);    }
    to   { transform: translate(30px, 20px) scale(1.08); }
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }
}