:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --background: #f8fafc;
    --panel-bg: rgba(255, 255, 255, 0.7);
    --header-bg: #ffffff;
    --border: rgba(226, 232, 240, 0.8);
    --text: #1e293b;
    --text-muted: #64748b;
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --input-bg: rgba(255, 255, 255, 0.5);
    --table-header-bg: #f8fafc;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --placeholder: #94a3b8;
    --track-bg-base: #ffffff;
    --type-header-bg: rgba(226, 232, 240, 0.4);
    --error: #ef4444;
    --error-hover: #dc2626;
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Dark Theme Variables */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --background: #0f172a;
        --panel-bg: rgba(30, 41, 59, 0.7);
        --header-bg: #1e293b;
        --border: rgba(51, 65, 85, 0.8);
        --text: #f1f5f9;
        --text-muted: #94a3b8;
        --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
        --input-bg: rgba(15, 23, 42, 0.5);
        --table-header-bg: #1e293b;
        --placeholder: #334155;
        --track-bg-base: #1e293b;
        --type-header-bg: rgba(15, 23, 42, 0.8);
    }
}

[data-theme="dark"] {
    --background: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --header-bg: #1e293b;
    --border: rgba(51, 65, 85, 0.8);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --input-bg: rgba(15, 23, 42, 0.5);
    --table-header-bg: #1e293b;
    --placeholder: #334155;
    --track-bg-base: #1e293b;
    --type-header-bg: rgba(15, 23, 42, 0.8);
    --error: #f87171;
    --error-hover: #ef4444;
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

html {
    overflow-y: scroll;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--background);
    background-image:
        radial-gradient(at 0% 0%, hsla(225, 39%, 30%, 0.05) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 20%, 0.03) 0, transparent 50%);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Page Transitions */
#page-wrapper.page-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
    min-height: 100vh;
}

#page-wrapper.page-transition.page-fade-in {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInGlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Site Header */
.site-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    transition: background 0.3s ease;
}

.site-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header-left {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.site-logo-link {
    display: flex;
    align-items: center;
    transition: opacity 0.15s ease;
}

.site-logo-link:hover {
    opacity: 0.8;
}

.site-title-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    padding-left: 1rem;
    border-left: 1px solid var(--border);
    transition: color 0.15s ease;
}

.site-title-link:hover {
    color: var(--primary);
}

.site-logo {
    height: 56px;
    width: auto;
    transition: filter 0.3s ease;
}

[data-theme="dark"] .site-logo {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.site-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.lang-switcher a {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.lang-switcher a:hover {
    color: var(--primary);
}

.lang-switcher a.active {
    color: var(--primary);
}

.lang-switcher .separator {
    color: var(--border);
    font-weight: 400;
}

.site-footer {
    background: var(--header-bg);
    border-top: 1px solid var(--border);
    padding: 3.5rem 0;
    margin-top: 2rem;
    transition: background 0.3s ease;
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
}

.site-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-footer-brand:hover {
    color: var(--primary);
}

.site-footer-brand span {
    font-weight: 600;
    padding-left: 1rem;
    border-left: 1px solid var(--border);
}

.site-footer-logo {
    height: 80px;
    width: auto;
    transition: filter 0.3s ease;
}

[data-theme="dark"] .site-footer-logo {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.site-footer-credit {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.site-footer-inner a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
}

.site-footer-inner a:hover {
    color: var(--primary);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    font-weight: 600;
    font-size: 0.8rem;
    margin-left: auto;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--primary);
    background: var(--header-bg);
}

.theme-toggle .moon-icon {
    display: block;
}

.theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
    gap: 1rem;
}

header>div:first-child {
    min-width: 0;
    overflow: hidden;
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #0f172a;
}

/* Field Translate Button */
.field-translate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.5;
}

.field-translate-btn:hover {
    opacity: 1;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.field-translate-btn.loading {
    pointer-events: none;
}

.field-translate-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Field Translate Button */
.field-translate-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    cursor: pointer;
    transition: opacity 0.2s ease;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    opacity: 0.6;
}

.field-translate-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

.field-translate-btn.warning {
    color: #ef4444;
    /* Emerald red / Rose */
    opacity: 0.9;
}

.field-translate-btn.visible {
    display: inline-flex;
}

.field-translate-btn.loading {
    pointer-events: none;
    opacity: 0.4;
    cursor: wait;
}

.field-translate-btn.loading i {
    animation: fieldSpin 1s linear infinite;
}

@keyframes fieldSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.field-translate-btn i {
    width: 14px;
    height: 14px;
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}

.breadcrumb-icon {
    width: 26px !important;
    height: 26px !important;
    color: var(--text-muted);
    flex-shrink: 0;
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    flex-shrink: 0;
}

/* Search Container & Clear Button */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-container input {
    padding-right: 2.5rem !important;
}

/* Auth / Login */
.site-header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-auth {
    position: relative;
}

.auth-logged-in {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text);
    background: var(--input-bg);
    padding: 0.4rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.auth-logged-in span {
    font-weight: 600;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

.auth-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.auth-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--input-bg);
    color: var(--text);
    padding: 0.4rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.auth-toggle-btn:hover {
    background: var(--panel-bg);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}


.auth-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
    margin-top: 0.5rem;
    z-index: 100;
    display: none;
}

.auth-dropdown.active {
    display: block;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.auth-field input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, transform 0.15s ease;
    border-radius: 50%;
}

.search-clear:hover {
    color: var(--primary);
    background-color: rgba(37, 99, 235, 0.05);
}

.search-clear svg {
    width: 18px;
    height: 18px;
}

.search-clear.visible {
    display: flex;
}

.breadcrumb .breadcrumb-title {
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb a:hover {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb .separator {
    opacity: 0.4;
    flex-shrink: 0;
}

.breadcrumb .current {
    color: var(--text);
    font-weight: 600;
    flex-shrink: 0;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.form-group {
    margin-bottom: 0.75rem;
    position: relative;
    overflow: visible;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    transition: all 0.2s ease;
}

::placeholder {
    color: var(--placeholder);
    opacity: 1;
    /* Firefox fix */
}

/* Internet Explorer 10-11 */
:-ms-input-placeholder {
    color: var(--placeholder);
}

/* Microsoft Edge */
::-ms-input-placeholder {
    color: var(--placeholder);
}

input[type="date"] {
    text-transform: uppercase;
    color: var(--placeholder);
    /* Placeholder color by default */
}

input[type="date"]:focus,
input[type="date"]:active,
input[type="date"].has-value {
    color: var(--text);
}

/* For WebKit browsers, we can also target the internal fields */
input[type="date"]::-webkit-datetime-edit {
    color: inherit;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--header-bg);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-group.error label {
    color: #ef4444;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

.form-group.error input:focus,
.form-group.error select:focus,
.form-group.error textarea:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 0.875rem;
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--error);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--error-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--header-bg);
    color: var(--secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
}

.card {
    background: var(--header-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #eff6ff;
    color: var(--primary);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.track-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--input-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.track-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    opacity: 0.75;
}

.track-item input[type="checkbox"] {
    display: none;
}

.track-item:hover {
    background: var(--input-bg);
    transform: translateY(-1px);
    opacity: 1;
}

.track-item.active {
    background: color-mix(in srgb, var(--track-color, var(--primary)) 20%, var(--track-bg-base));
    box-shadow: 0 2px 8px color-mix(in srgb, var(--track-color, var(--primary)) 25%, transparent);
    border-color: var(--track-color, var(--primary));
    color: var(--text);
    opacity: 1;
    font-weight: 600;
}

section {
    margin-bottom: 1.5rem;
}

section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--text);
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
}

/* Table View Styles */
.table-wrapper {
    transition: opacity 0.2s ease;
}

.table-container {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    table-layout: fixed;
}

.table-container th {
    text-align: left;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.table-container td {
    padding: 0.4rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.table-container tr:last-child td {
    border-bottom: none;
}

.clickable-row {
    cursor: pointer;
}

.btn-apply-pill {
    background: #10b981;
    /* Emerald 500 */
    color: white !important;
    padding: 0.25rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s ease;
    border: none;
    white-space: nowrap;
}

.btn-apply-pill:hover {
    background: #059669;
    /* Emerald 600 */
    color: white !important;
}

/* Document Boxes in Course View */
.doc-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--header-bg);
    border: 2px solid color-mix(in srgb, var(--primary) 15%, var(--border));
    border-radius: 12px;
    text-decoration: none;
    color: var(--text) !important;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    width: 100%;
}

.doc-box:hover {
    border-color: var(--primary);
    background: var(--background);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.doc-box i {
    color: var(--primary);
    flex-shrink: 0;
}


.table-container tr:hover td {
    background: var(--input-bg);
}

.table-container td a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.table-container td a:hover {
    color: var(--primary);
}

.clickable-row.not-published td {
    background-color: rgba(239, 68, 68, 0.04) !important;
}

.clickable-row.not-published:hover td {
    background-color: rgba(239, 68, 68, 0.08) !important;
}

.clickable-row.not-published td:first-child {
    border-left: 3px solid #ef4444;
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Icon Styles */
.lucide {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
}

.btn .lucide {
    width: 16px;
    height: 16px;
    margin-right: 0.25rem;
}

.btn-secondary .lucide {
    color: var(--secondary);
}

.btn-icon {
    background: transparent !important;
    border-color: transparent !important;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(226, 232, 240, 0.6) !important;
    border-color: var(--border) !important;
}

.btn-icon .lucide {
    margin-right: 0;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.btn-icon:hover .lucide {
    opacity: 1;
}

.btn-sm {
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Track Dot Styles */
.track-dot-container {
    display: flex;
    gap: 4px;
}

.track-dot {
    min-width: 17px;
    height: 17px;
    padding: 0;
    border-radius: 8.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: white;
    font-weight: 700;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    flex-shrink: 0;
}

.track-dot.empty {
    visibility: hidden;
}

.track-legend .track-dot {
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 0.7rem;
}

/* Legend Styles */
.track-legend {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--input-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--secondary);
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    opacity: 0.75;
}

.legend-item:hover {
    background: var(--input-bg);
    transform: translateY(-1px);
    opacity: 1;
}

.legend-item.active {
    background: color-mix(in srgb, var(--track-color, var(--primary)) 20%, var(--track-bg-base));
    border-color: var(--track-color, var(--primary));
    color: var(--text);
    opacity: 1;
    font-weight: 600;
}

/* Custom Select */
.custom-select-wrapper {
    position: relative;
}

.custom-select {
    position: relative;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--header-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: border-color 0.2s ease;
}

.custom-select-trigger:hover {
    border-color: var(--primary);
}

.custom-select.open {
    z-index: 200;
}

.custom-select.open .custom-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.custom-select-options {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--header-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--glass-shadow);
    z-index: 100;
}

.custom-select.open .custom-select-options {
    display: block;
}

.custom-select-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s ease;
}

.custom-select-option:hover {
    background: rgba(37, 99, 235, 0.06);
}

.custom-select-option.selected {
    background: rgba(37, 99, 235, 0.08);
    font-weight: 600;
    color: var(--primary);
}

/* Language field rows in manage.php */
.lang-field-row {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.lang-field-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.lang-field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

/* Type Headers in Table */
.type-header td {
    background: var(--type-header-bg) !important;
    font-weight: 700;
    color: var(--text);
    padding: 0.6rem 0.75rem !important;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border) !important;
}

.type-header td:first-child {
    border-left: 4px solid #5e5e5e !important;
}

.type-header:not(:first-child) td {
    padding-top: 0.8rem !important;
}

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

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

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-icon {
    width: 64px;
    height: 64px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.modal-description {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Document Upload Styles */
.doc-upload-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.doc-existing {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 8px;
}

.doc-file-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.15s ease;
}

.doc-file-link:hover {
    opacity: 0.75;
}

.doc-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1.5px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--secondary);
    transition: all 0.2s ease;
}

.doc-upload-label:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.03);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Home Page */
.home-hero {
    min-height: 55vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

#hero-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 50%),
        radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.08), transparent 50%);
    /* More atmospheric bottom fade - only on background/canvas */
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 12px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

@media (max-width: 850px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    text-align: center;
    padding: 3rem 2rem !important;
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
}

.feature-icon .lucide {
    width: 32px;
    height: 32px;
}

.search-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.apply-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.tracks-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

.feature-desc {
    color: var(--text-muted);
    line-height: 1.5;
}

.cta-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3rem 4rem !important;
    background: var(--panel-bg);
    margin-bottom: 5rem;
}

@media (max-width: 768px) {
    .cta-section {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        padding: 2.5rem !important;
    }
}

.cta-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.cta-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Header & Navigation Fixes */
.site-logo-link {
    display: flex;
    align-items: center;
}