:root {
    /* Premium Dark Theme Palette */
    --bg-base: #0f172a;
    /* Slate 950 - Rich Dark */
    --bg-gradient-1: #1e293b;
    /* Slate 800 */
    --bg-gradient-2: #334155;
    /* Slate 700 */

    --card-bg: rgba(30, 41, 59, 0.7);
    /* Translucent Slate */
    --card-border: rgba(255, 255, 255, 0.1);

    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.15);
    --input-focus: #3b82f6;
    /* Blue 500 */

    --text-primary: #f8fafc;
    /* Slate 50 */
    --text-secondary: #94a3b8;
    /* Slate 400 */
    --brand-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
    /* Blue to Purple */
    --brand-gradient-hover: linear-gradient(135deg, #2563eb, #7c3aed);

    --danger: #ef4444;
    --success: #22c55e;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

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

body {
    background-color: var(--bg-base);
    /* Subtle Mesh Gradient Background to fix "Hollow" feel */
    background-image:
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px 10px;
}

.app-container {
    width: 100%;
    max-width: 650px;
    /* Slightly wider for breathing room */
    position: relative;
    z-index: 1;
    /* Above background */
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

h1 {
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 5px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(59, 130, 246, 0.2);
    letter-spacing: -1px;
}

.header p {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

/* Cards (Glassmorphism) */
.card,
.container>form,
#login-view {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

/* Specific overrides for containers that don't need double card styling */
.container>form {
    padding: 0;
    background: transparent;
    border: none;
    backdrop-filter: none;
    box-shadow: none;
}

#login-view {
    /* Login view stays as a card itself */
    padding: 40px 24px;
}

h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.half-width {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    /* Slate 300 */
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background-color: rgba(15, 23, 42, 0.8);
}

input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* Tag Input Styling */
.tag-container {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 50px;
}

.tag-container:focus-within {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.tag {
    background: linear-gradient(to bottom, #334155, #1e293b);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.tag-remove {
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    transition: color 0.1s;
}

.tag-remove:hover {
    color: #ef4444;
}

.tag-input {
    flex: 1;
    min-width: 120px;
    background: transparent;
    border: none;
    padding: 4px;
    box-shadow: none !important;
    /* Override focus styles */
}

/* Autocomplete Dropdown */
.autocomplete-items {
    position: absolute;
    border: 1px solid var(--input-border);
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background-color: #1e293b;
    /* Solid opacity for readability */
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.autocomplete-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.1s;
}

.autocomplete-item:hover {
    background-color: #334155;
    color: #fff;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    background: var(--brand-gradient-hover);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Success Message */
.success-msg {
    text-align: center;
    color: var(--success);
    font-weight: 600;
    margin-top: 15px;
    min-height: 24px;
}

/* Error Message */
.error-msg {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
}

/* Admin Panel */
.admin-panel {
    margin-top: 40px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
}

/* Progress Bar */
.progress-container {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    width: 100%;
    margin-bottom: 20px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--brand-gradient);
    transition: width 0.3s;
}

/* Utility */
.hidden {
    display: none;
}

.form-group-relative {
    position: relative;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}