/* Minimal Modern Style for NDR Core */
/* Uses the color palette system from colors.css */

/* Typography - Large and beautiful */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.125rem;
    line-height: 1.75;
    background: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.display-3, .display-4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--title-color);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
    color: var(--title-color);
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* Container with wider max-width */
.container-xxl {
    max-width: 1400px;
}

/* Transparent navbar that becomes solid on scroll */
#mainNav {
    background: transparent;
    backdrop-filter: blur(0px);
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

#mainNav.navbar-scrolled {
    background: var(--container-bg-color);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

[data-theme="dark"] #mainNav.navbar-scrolled {
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Page title in navbar — visible only when scrolled */
.nav-page-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    margin-left: 0.75rem;
}

#mainNav.navbar-scrolled .nav-page-title {
    opacity: 1;
    transform: translateY(0);
}

/* Small logo that appears next to page title when scrolled */
.nav-scrolled-logo {
    height: 28px;
    width: auto;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    margin-left: 0.25rem;
    border-radius: 4px;
}

#mainNav.navbar-scrolled .nav-scrolled-logo {
    opacity: 1;
    transform: translateY(0);
}

/* Navbar brand */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color-1) !important;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: var(--accent-color-2) !important;
}

/* Nav links - clean and minimal */
.navbar-nav .nav-link {
    color: var(--nav-link-color) !important;
    font-weight: 500;
    padding: 0.35rem 1rem !important;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-color-1) !important;
}

.navbar-nav .nav-link.active {
    color: var(--accent-color-1) !important;
}

/* Underline effect for active links — use ::after for plain links, ::before for dropdown
   toggles (Bootstrap occupies ::after with its caret) */
.navbar-nav .nav-link.active:not(.dropdown-toggle)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--accent-color-1);
}

.navbar-nav .nav-link.active.dropdown-toggle::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--accent-color-1);
}

/* Dropdown menus */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: var(--container-bg-color);
    --bs-dropdown-link-hover-color: var(--button-text-color);
    --bs-dropdown-link-hover-bg: var(--accent-color-1);
    --bs-dropdown-link-active-color: var(--button-text-color);
    --bs-dropdown-link-active-bg: var(--accent-color-1);
}

[data-theme="dark"] .dropdown-menu {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--accent-color-1) !important;
    color: var(--button-text-color) !important;
}

.dropdown-item:hover i,
.dropdown-item:focus i,
.dropdown-item.active i,
.dropdown-item:active i {
    color: var(--button-text-color) !important;
}

/* Content wrapper */
.content-wrapper {
    min-height: calc(100vh - 200px);
}

/* Page title section */
.page-title-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.page-title-section h1 {
    position: relative;
    display: inline-block;
}

.page-title-section h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-color-1);
    border-radius: 2px;
}

/* CKEditor table width fix: the editor puts width on the <figure> wrapper,
   but the inner <table> defaults to shrink-to-fit. Make it fill the figure. */
figure.table {
    max-width: 100%;
}
figure.table table {
    width: 100%;
}

/* Content card - subtle elevation */
.content-card {
    background: var(--container-bg-color);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

[data-theme="dark"] .content-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.content-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .content-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Card variations for generated content */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    background: var(--container-bg-color);
}

[data-theme="dark"] .card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}


/* Floating scroll-to-top button */
.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-color-1);
    color: var(--button-text-color);
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: var(--accent-color-2);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px);
}

.scroll-top-btn:active {
    transform: translateY(-2px);
}

/* Footer - Modern Design */
.modern-footer {
    background: var(--footer-bg);
    color: var(--footer-link-color);
    border-top: 1px solid rgba(128, 128, 128, 0.1);
    margin-top: 5rem;
}

[data-theme="dark"] .modern-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Footer main content area */
.minimal-modern-footer-wrapper .footer-main {
    padding: 3rem 0;
}

/* Footer headings */
.footer-heading {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--title-color);
    margin-bottom: 1rem;
}

/* Footer logo */
.footer-logo {
    margin-bottom: 1.5rem;
}

.footer-logo img {
    max-height: 60px;
    width: auto;
    transition: opacity 0.3s ease;
}

.footer-logo a:hover img {
    opacity: 0.8;
}

/* Footer navigation */
.footer-navigation {
    margin: 0;
}

.footer-navigation .navbar-nav {
    flex-direction: column;
    padding: 0;
    margin: 0;
}

.footer-navigation .nav-item {
    margin-bottom: 0.2rem;
}

.footer-navigation .footer-link {
    color: var(--footer-link-color) !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.footer-navigation .footer-link:hover {
    color: var(--footer-link-hover-color) !important;
    padding-left: 0.5rem;
}

/* Footer socials */
.footer-socials .social-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--title-color);
    margin-bottom: 1rem;
}

.footer-socials .social-icons {
    display: flex;
    gap: 1rem;
}

.footer-socials .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.1);
    color: var(--text-color);
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1.125rem;
}

.footer-socials .social-link:hover {
    background: var(--accent-color-1);
    color: var(--button-text-color);
    transform: translateY(-3px);
}

[data-theme="dark"] .footer-socials .social-link {
    background: rgba(255, 255, 255, 0.1);
}

/* Footer copyright */
.footer-copyright {
    color: var(--footer-link-color);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.6;
}

/* Footer partners section */
.footer-partners-section {
    padding: 3rem 0;
    border-top: 1px solid rgba(128, 128, 128, 0.05);
}

[data-theme="dark"] .footer-partners-section {
    border-top-color: rgba(255, 255, 255, 0.05);
}

.footer-partners-section .footer-heading {
    font-size: 1rem;
}

/* Partner logos styling */
.footer-partners {
    margin-top: 2rem;
}

.footer-partners .partner-logo {
    filter: grayscale(100%) opacity(0.6);
    transition: all 0.3s ease;
}

.footer-partners a:hover .partner-logo,
.footer-partners .partner-logo:hover {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.05);
}

/* Responsive footer adjustments */
@media (max-width: 768px) {
    .minimal-modern-footer-wrapper .footer-main {
        padding: 2rem 0;
    }

    .footer-navigation .footer-link {
        font-size: 0.9rem;
    }

    .footer-socials .social-icons {
        gap: 0.75rem;
    }

    .footer-socials .social-link {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .footer-partners-section {
        padding: 2rem 0;
    }

    .footer-logo img {
        max-height: 50px;
    }
}

/* Smooth animations for content */
.card,
.page-title-section {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons - modern and clean */
.btn {
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--button-color);
    color: var(--button-text-color);
}

.btn-primary:hover {
    background: var(--button-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Forms - clean and minimal */
.form-control,
.form-select {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(128, 128, 128, 0.2);
    background: var(--form-field-bg);
    color: var(--form-field-fg);
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color-1);
    box-shadow: 0 0 0 0.25rem rgba(0, 176, 185, 0.1);
}

/* Tables - modern styling */
.table {
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    border-bottom: 2px solid var(--accent-color-1);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

/* Links - accent colored */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--accent-color-2);
    text-decoration: underline;
}

/* Alerts - modern design */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
}

/* Badges - rounded */
.badge {
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
}

/* Theme toggle button styling */
#themeToggle {
    color: var(--nav-link-color);
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#themeToggle:hover {
    background: rgba(128, 128, 128, 0.1);
    color: var(--accent-color-1);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .content-card {
        padding: 2rem;
    }

    .page-title-section {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }

    .scroll-top-btn {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 1rem;
    }

    .content-card {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .scroll-top-btn {
        width: 44px;
        height: 44px;
    }
}

/* Accessibility - focus states */
*:focus-visible {
    outline: 2px solid var(--accent-color-1);
    outline-offset: 2px;
}

/* Loading states for dynamic content */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Utility classes */
.text-accent {
    color: var(--accent-color-1) !important;
}

.bg-accent {
    background: var(--accent-color-1) !important;
    color: var(--button-text-color) !important;
}

/* Search form — compact layout (minimal-modern style)
   Add `ndr-search-form` class alongside `content-card` to activate. */
.ndr-search-form {
    padding: 1.5rem 2rem;
}

/* Text inputs / number inputs */
.ndr-search-form .form-control {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
}

/* Native select — preserve Bootstrap's right-side arrow space */
.ndr-search-form .form-select {
    padding: 0.35rem 2.25rem 0.35rem 0.75rem;
    border-radius: 8px;
}

/* Select2 single — override custom_select2.css !important padding */
.ndr-search-form .select2-selection--single .select2-selection__rendered {
    padding: calc(0.35rem + 2px) 2.5rem calc(0.35rem + 2px) 0.75rem !important;
    line-height: 1.5 !important;
}

/* Select2 multiple */
.ndr-search-form .select2-selection--multiple {
    min-height: 36px !important;
}
.ndr-search-form .select2-selection--multiple .select2-selection__rendered {
    /* 36px left padding keeps the "clear all" × (at left:8px, width:20px) from overlapping the first badge */
    padding: 4px 2.5rem 4px 36px !important;
}

/* Select2 dropdown options — smaller font (dropdown is appended to body, can't scope to .ndr-search-form) */
.select2-results__option {
    font-size: 0.875rem !important;
}

.ndr-search-form label {
    margin-bottom: 0.1rem;
    font-size: 0.875rem;
}

/* crispy-bootstrap5 wraps each field in mb-3 — tighten the row gap */
.ndr-search-form .mb-3 {
    margin-bottom: 0.4rem !important;
}

/* Page header background for special pages */
.page-header-bg {
    background: linear-gradient(135deg, var(--accent-color-1) 0%, var(--accent-color-2) 100%);
    padding: 4rem 2rem;
    border-radius: 20px;
    margin-bottom: 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .page-header-bg {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}