/*
 * NEOUS Design System
 * shadcn-inspired clean, minimal design with subtle depth and polish
 */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&family=Playfair+Display:wght@400;500&display=swap');

:root {
    /* Core colors - NEOUS identity (no purple, no gradients) */
    --primary: #0F172A;
    --accent: #0EA5E9;
    --gold: #F59E0B;
    --silver: #94A3B8;
    --warm-white: #F8FAFC;

    /* Pastel palette (cyan replaces purple) */
    --pastel-cyan: #E0F2FE;
    --pastel-purple: #E0F2FE; /* Alias for backwards compatibility */
    --pastel-blue: #E0E8F0;
    --pastel-gold: #FEF3C7;
    --pastel-green: #DCFCE7;
    --pastel-pink: #FCE7F3;

    /* shadcn-inspired neutral palette */
    --background: #ffffff;
    --foreground: #0F172A;
    --muted: #f4f4f5;
    --muted-foreground: #64748B;
    --border: #e2e8f0;
    --input: #e2e8f0;
    --ring: #0EA5E9;

    /* Legacy aliases */
    --text-dark: var(--foreground);
    --text-muted: var(--muted-foreground);
    --text-light: #a1a1aa;
    --border-light: var(--border);
    --success: #16a34a;
    --destructive: #dc2626;

    /* shadcn-inspired spacing */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.625rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    font-weight: 300;
    line-height: 1.7;
    color: var(--foreground);
    background: var(--background);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    line-height: 1.3;
    color: var(--foreground);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: 0.1em;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
    color: var(--muted-foreground);
}

a {
    color: var(--foreground);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent);
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Cards - shadcn style */
.card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.card-highlight {
    background: var(--pastel-cyan);
    border: none;
}

/* Highlight Boxes */
.highlight-cyan,
.highlight-purple {
    display: inline-block;
    background: var(--pastel-cyan);
    color: var(--accent);
    padding: 0.4rem 1rem;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border-radius: var(--radius);
}

.highlight-green {
    display: inline-block;
    background: var(--pastel-green);
    color: var(--success);
    padding: 0.4rem 1rem;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border-radius: var(--radius);
}

.highlight-blue {
    display: inline-block;
    background: var(--pastel-blue);
    color: var(--primary);
    padding: 0.4rem 1rem;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    border-radius: var(--radius);
}

.highlight-gold {
    display: inline-block;
    background: var(--pastel-gold);
    color: #8B7500;
    padding: 0.4rem 1rem;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border-radius: var(--radius);
}

/* Header/Navigation */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--foreground);
    letter-spacing: 0.15em;
}

nav a {
    color: var(--muted-foreground);
    font-size: 0.8rem;
    margin-left: 1.5rem;
    letter-spacing: 0.05em;
    transition: color 0.15s ease;
}

nav a:hover {
    color: var(--foreground);
}

/* Forms - shadcn style */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    background: var(--background);
    color: var(--foreground);
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgb(14 165 233 / 0.2);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted-foreground);
    opacity: 0.6;
}

input:disabled,
textarea:disabled,
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--muted);
}

/* Buttons - shadcn style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: all 0.15s ease;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* Primary button - solid dark */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-primary:hover {
    background: #002a54;
    border-color: #002a54;
    color: #fff;
}

/* Secondary button - outline style */
.btn-secondary {
    background: var(--background);
    border-color: var(--input);
    color: var(--foreground);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-secondary:hover {
    background: var(--muted);
    border-color: var(--border);
    color: var(--foreground);
}

/* Ghost button */
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--foreground);
}

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

/* Destructive button */
.btn-destructive {
    background: var(--destructive);
    border-color: var(--destructive);
    color: #fff;
}

.btn-destructive:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* Link button */
.btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--foreground);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Button sizes */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.625rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-icon {
    padding: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
}

/* Alerts - shadcn style */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border-radius: var(--radius-lg);
    border: 1px solid;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

/* Status Indicators - shadcn badge style */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: 9999px;
    border: 1px solid transparent;
}

.status-active {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.status-active::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.status-pending::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #f59e0b;
    border-radius: 50%;
}

.status-inactive {
    background: var(--muted);
    color: var(--muted-foreground);
    border-color: var(--border);
}

.status-inactive::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--muted-foreground);
    border-radius: 50%;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Badge - new shadcn component */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid transparent;
    transition: background-color 0.15s ease;
}

.badge-default {
    background: var(--primary);
    color: #fff;
}

.badge-secondary {
    background: var(--muted);
    color: var(--muted-foreground);
    border-color: var(--border);
}

.badge-outline {
    background: transparent;
    color: var(--foreground);
    border-color: var(--border);
}

.badge-destructive {
    background: var(--destructive);
    color: #fff;
}

/* Tables - shadcn style */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 500;
    color: var(--muted-foreground);
    font-size: 0.8rem;
    background: var(--muted);
}

tr:hover {
    background: var(--muted);
}

/* Separator */
.separator {
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

/* Avatar - new shadcn component */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--muted);
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 3rem;
    height: 3rem;
    font-size: 1rem;
}

/* Skeleton - loading state */
.skeleton {
    background: linear-gradient(90deg, var(--muted) 25%, #e8e8eb 50%, var(--muted) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius);
}

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

/* Footer */
footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--muted-foreground); }
.text-small { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }

.border { border: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Subtitle/Tagline */
.tagline,
.subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

/* Dropdown/Select styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Checkbox and Radio - shadcn style */
input[type="checkbox"],
input[type="radio"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
    cursor: pointer;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
}

/* Tooltip base (JS required for full functionality) */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    background: var(--foreground);
    color: var(--background);
    border-radius: var(--radius);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    margin-bottom: 0.25rem;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Progress bar */
.progress {
    width: 100%;
    height: 0.5rem;
    background: var(--muted);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Switch/Toggle (checkbox-based) */
.switch {
    position: relative;
    display: inline-block;
    width: 2.75rem;
    height: 1.5rem;
}

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

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--input);
    transition: 0.2s;
    border-radius: 9999px;
}

.switch-slider::before {
    position: absolute;
    content: "";
    height: 1.25rem;
    width: 1.25rem;
    left: 0.125rem;
    bottom: 0.125rem;
    background: white;
    transition: 0.2s;
    border-radius: 50%;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.1);
}

.switch input:checked + .switch-slider {
    background: var(--primary);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(1.25rem);
}

.switch input:focus + .switch-slider {
    box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    nav a {
        margin: 0 0.75rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .btn + .btn {
        margin-top: 0.5rem;
    }
}

/* Print styles */
@media print {
    .btn,
    nav,
    .no-print {
        display: none !important;
    }
}
