/* 
 * ANDAMIOSCAN DESIGN SYSTEM 2026
 * Theme: Premium Future Glass (Enhanced)
 * Supports: Light & Dark Mode
 */

/* =========================================
   1. TOKENS (HSL VARIABLES)
   ========================================= */
:root {
    /* Brand Colors (Strictly from Color System) */
    /* Scaffold Orange #FF6B35 */
    --primary: 16 100% 60%;
    --primary-foreground: 0 0% 100%;

    /* Foundation Blue #004E89 */
    --secondary: 206 100% 27%;
    --secondary-foreground: 0 0% 98%;

    /* Construct Teal #1B998B */
    --accent: 173 70% 35%;
    --accent-foreground: 0 0% 100%;

    /* Canvas Cream #FFF8F0 */
    --background: 33 100% 97%;
    --foreground: 218 17% 35%;

    /* 2026 Premium Surfaces (Light Mode) */
    /* Translucent White */
    --card: 0 0% 100%;
    --card-foreground: 218 17% 35%;
    --card-border: 0 0% 100%;
    /* Invisible/White border for glass effect */

    --muted: 33 50% 90%;
    --muted-foreground: 218 17% 45%;

    --border: 206 30% 90%;
    --input: 206 30% 90%;

    --radius: 1rem;
    /* More rounded for modern feel */
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --shadow-hover: 0 12px 40px -4px rgba(0, 78, 137, 0.15);

    /* Gradients */
    --gradient-mesh: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E"), radial-gradient(at 0% 0%, hsla(16, 100%, 82%, 0.4) 0px, transparent 50%), radial-gradient(at 100% 0%, hsla(206, 100%, 75%, 0.4) 0px, transparent 55%), radial-gradient(at 100% 100%, hsla(173, 70%, 70%, 0.3) 0px, transparent 50%), radial-gradient(at 0% 100%, hsla(33, 100%, 93%, 1) 0px, transparent 50%);

    /* Semantic Events */
    --color-mint: 173 70% 35%;
    --color-enroll: 161 94% 30%;
    --color-process: 206 100% 27%;
    --color-claim: 16 100% 60%;

    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

.dark {
    /* Background #0f1419 -> Deep Navy/Black */
    --background: 210 25% 8%;
    --foreground: 216 27% 95%;

    /* Translucent Black for Glass */
    --card: 210 25% 12%;
    --card-foreground: 216 27% 95%;
    --card-border: 210 25% 20%;

    /* Primary Dark #FF7A52 */
    --primary: 14 100% 66%;
    --primary-foreground: 210 25% 8%;

    /* Secondary Dark #3b82f6 */
    --secondary: 217 91% 60%;
    --secondary-foreground: 210 25% 8%;

    --muted: 225 28% 14%;
    --muted-foreground: 214 17% 71%;

    --border: 225 28% 14%;

    /* Dark Gradients - Subtle Glows */
    --gradient-mesh: radial-gradient(at 0% 0%, hsla(14, 100%, 66%, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(217, 91%, 60%, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(172, 66%, 50%, 0.1) 0px, transparent 50%);

    --shadow-glass: 0 4px 30px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 10px 40px -4px rgba(0, 0, 0, 0.7);
}

/* =========================================
   2. GLOBAL RESET & BASE
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    border-color: hsl(var(--border));
}

html {
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: hsl(var(--background));
    background-image: var(--gradient-mesh);
    background-attachment: fixed;
    color: hsl(var(--foreground));
    font-feature-settings: "rlig" 1, "calt" 1;
    transition: color 0.3s ease;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* =========================================
   3. GLASSMORPHISM UTILITIES
   ========================================= */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.dark .glass {
    background: rgba(20, 25, 35, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* =========================================
   4. COMPONENT OVERHAUL
   ========================================= */

/* Premium Card (Glass) */
.card {
    background: hsla(var(--card), 0.6);
    /* Translucent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid hsla(var(--foreground), 0.05);
    /* Subtle border */
    border-radius: var(--radius);
    color: hsl(var(--card-foreground));
    box-shadow: var(--shadow-glass);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Subtle inner glow on light mode cards */
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    opacity: 0.5;
}

.dark .card::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

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

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid hsla(var(--foreground), 0.05);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, hsl(var(--foreground)) 0%, hsl(var(--muted-foreground)) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-description {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.25rem;
}

.card-content {
    padding: 1.5rem;
}

/* Premium Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    /* Pill shape */
    font-size: 0.875rem;
    font-weight: 600;
    height: 2.5rem;
    padding: 0 1.25rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

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

.btn:active {
    transform: translateY(0);
}

/* Primary Button with subtle gradient */
.btn-primary {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(16, 100%, 55%));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 4px 14px 0 rgba(255, 107, 53, 0.39);
}

.dark .btn-primary {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(14, 100%, 60%));
    box-shadow: 0 4px 14px 0 rgba(255, 122, 82, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px 0 rgba(255, 107, 53, 0.23);
    filter: brightness(1.1);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
}

.btn-outline:hover {
    border-color: hsl(var(--primary));
    color: hsl(var(--primary));
    background: hsla(var(--primary), 0.05);
}

.btn-ghost {
    background: transparent;
    color: hsl(var(--muted-foreground));
}

.btn-ghost:hover {
    background: hsla(var(--foreground), 0.05);
    color: hsl(var(--foreground));
}

.btn-icon {
    width: 2.5rem;
    padding: 0;
}

/* Modern Badges */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.025em;
    backdrop-filter: blur(4px);
    border: 1px solid transparent;
}

/* Semantic Badges tailored to tokens */
.badge-mint {
    background: hsla(var(--color-mint), 0.1);
    color: hsl(var(--color-mint));
    border-color: hsla(var(--color-mint), 0.2);
}

.badge-enroll {
    background: hsla(var(--color-enroll), 0.1);
    color: hsl(var(--color-enroll));
    border-color: hsla(var(--color-enroll), 0.2);
}

.badge-process {
    background: hsla(var(--color-process), 0.1);
    color: hsl(var(--color-process));
    border-color: hsla(var(--color-process), 0.2);
}

.badge-claim {
    background: hsla(var(--color-claim), 0.1);
    color: hsl(var(--color-claim));
    border-color: hsla(var(--color-claim), 0.2);
}

.badge-secondary {
    background: hsla(var(--secondary), 0.1);
    color: hsl(var(--secondary));
    border-color: hsla(var(--secondary), 0.2);
}

/* Modern Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    background: transparent;
    /* Let card bg handle it */
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

thead th {
    height: 3rem;
    padding: 0 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    background: hsla(var(--muted), 0.3);
    border-bottom: 1px solid hsla(var(--foreground), 0.05);
}

tbody tr {
    transition: background-color 0.2s;
}

tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid hsla(var(--foreground), 0.03);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background-color: hsla(var(--primary), 0.03);
}

/* Floating Table Styling (Optional per page) */


/* Data Lists */
.data-list {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .data-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.data-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
}

.data-value {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: hsl(var(--foreground));
    word-break: break-all;
}

/* Code Blocks */
.code-block {
    background: hsla(var(--muted), 0.5);
    border: 1px solid hsla(var(--foreground), 0.05);
    border-radius: var(--radius);
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    overflow-x: auto;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--secondary)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-flex;
}

.tooltip .tooltip-text {
    display: none;
    position: absolute;
    z-index: 50;
    bottom: calc(100% + 8px);
    right: 0;
    width: max-content;
    max-width: 220px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    color: hsl(var(--foreground));
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0.5rem;
    border-width: 6px;
    border-style: solid;
    border-color: hsl(var(--card)) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    display: block;
}