@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

html, body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    line-height: 1.6;
    color: #111;
}

* {
    box-sizing: border-box;
}

.page {
    max-width: 100%;
    overflow-x: hidden;
}

:root {
    --bfbk-red: #c8102e;
    --bfbk-dark-red: #a00d26;
    --surface: #ffffff;
    --surface-muted: #f7f7f8;
    --text-primary: #111111;
    --text-secondary: #5b5b5b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 6px 18px rgba(0,0,0,0.12);
    --shadow-lg: 0 16px 30px rgba(0,0,0,0.15);
}

h1:focus {
    outline: none;
}

/* Global Header Styles */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

.page-title, .section-title {
    color: var(--text-primary);
    font-weight: 700;
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.6rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 72px;
    height: 3px;
    background-color: var(--bfbk-red);
    border-radius: 2px;
}

/* Premium page title (subtle) */
.page-title {
    margin: 0 0 1rem 0;
    font-weight: 800;
    letter-spacing: -0.02em;
    position: relative;
}
.page-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 90px;
    height: 3px;
    background: var(--bfbk-red);
    border-radius: 2px;
}

a, .btn-link { color: var(--bfbk-red); text-decoration: none; }
a:hover { color: var(--bfbk-dark-red); }
a:focus-visible, .btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: var(--radius-sm); }

.btn { border-radius: var(--radius-sm); transition: background-color .15s ease, box-shadow .15s ease, color .15s ease; }
.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, var(--bfbk-red), var(--bfbk-dark-red));
    border-color: rgba(0,0,0,0.06);
    box-shadow: 0 8px 24px rgba(200,16,46,0.12);
}
.btn-primary:hover {
    filter: brightness(0.98);
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(200,16,46,0.14);
}
.btn-outline-primary { color: var(--bfbk-red); border-color: var(--bfbk-red); }
.btn-outline-primary:hover { color: #fff; background-color: var(--bfbk-red); }

.content {
    padding-top: 1.1rem;
}

/* Utility card for consistent panels */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    border: 1px solid rgba(15,23,42,0.04);
}

/* Form control styling for inputs and selects */
.form-control {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #e6e6e9;
    background: #fff;
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--bfbk-red);
    box-shadow: 0 6px 18px rgba(200,16,46,0.06);
    transform: translateY(-1px);
}

/* Navigation Styles - Override default link styles */
.navbar-container {
    background: rgba(255,255,255,0.96);
    border-bottom: 1px solid rgba(200,16,46,0.25);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: saturate(110%) blur(6px);
}

.main-navbar {
    width: 100%;
    padding: 0.5rem 0;
    min-height: 80px;
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    min-height: 70px;
}

.navbar-brand-section {
    height: 100%;
    display: flex;
    align-items: center;
}

.navbar-brand-section .brand-link {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    color: var(--bfbk-red) !important;
    transition: all 0.3s ease;
    height: 60px;
    padding: 0.5rem 0;
}

.navbar-brand-section .brand-link:hover {
    color: var(--bfbk-dark-red) !important;
    text-decoration: none !important;
    transform: scale(1.05);
}

.flag-logo {
    height: 50px;
    width: auto;
    aspect-ratio: 4/3;
    margin-right: 1.2rem;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    object-fit: cover;
}

.brand-text {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 800;
    font-size: 2.2rem;
    letter-spacing: 1.2px;
    line-height: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    padding: 0.25rem 0;
    margin: 0.25rem 0;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-links::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.8), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-links:hover::after {
    opacity: 1;
}

.nav-links .nav-link {
    padding: 0.5rem 0.75rem !important;
    color: #333 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    white-space: nowrap;
    background-color: transparent !important;
    border: 1px solid transparent !important;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.nav-links .nav-link:hover {
    background-color: #fafbfc !important;
    color: var(--bfbk-red) !important;
    text-decoration: none !important;
    transform: translateY(-0.5px);
}

.nav-links .nav-link.active {
    background-color: transparent !important;
    color: var(--bfbk-red) !important;
    text-decoration: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    position: relative;
}
.nav-links .nav-link.active::after {
    content: '';
    position: absolute; left: 8px; right: 8px; bottom: 3px;
    height: 2px; background: var(--bfbk-red); border-radius: 2px;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    gap: 4px;
    transition: transform .25s ease;
}

.toggle-line {
    width: 20px;
    height: 2px;
    background-color: var(--bfbk-red);
    transition: all 0.3s ease;
}

.mobile-toggle:hover .toggle-line {
    background-color: var(--bfbk-dark-red);
}

.mobile-toggle.active .toggle-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.mobile-toggle.active .toggle-line:nth-child(2) {
    opacity: 0;
}
.mobile-toggle.active .toggle-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .main-navbar {
        min-height: 60px;
    }
    
    .navbar-content {
        flex-wrap: wrap;
        padding: 0 1rem;
        min-height: 50px;
    }
    
    .navbar-brand-section .brand-link {
        height: 45px;
    }
    
    .brand-text {
        font-size: 2.2rem;
        letter-spacing: 1.8px;
    }
    
    .flag-logo {
        height: 38px;
        margin-right: 1rem;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .nav-links {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        display: block; /* allow height transition */
        overflow: hidden;
        gap: 0.25rem;
        /* collapsed defaults */
        max-height: 0;
        opacity: 0;
        margin-top: 0;
        border-top: 0;
        padding-top: 0; /* will animate on expand */
        transition: max-height .3s ease, opacity .25s ease, padding .25s ease, margin .25s ease, border-color .25s ease;
    }
    
    .nav-links > * { min-height: 0; }

    .nav-links.collapsed { max-height: 0; opacity: 0; padding-top: 0; margin-top: 0; border-top: 0; }
    .nav-links.expanded { max-height: 600px; opacity: 1; padding-top: 1rem; margin-top: 1rem; border-top: 1px solid #eee; }
    
    .nav-links .nav-link {
        padding: 0.75rem 1rem !important;
        text-align: left;
        font-size: 1rem !important;
    }
}

/* Page is visible by default; fades can be applied via JS classes if needed */

/* Desktop Navigation Styles */
@media (min-width: 769px) {
    .nav-links.collapsed {
        display: flex !important;
    }
    
    .navbar-content {
        flex-wrap: nowrap;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-links {
        gap: 0.25rem;
    }
    
    .nav-links .nav-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.9rem;
    }
}

/* Motion accessibility */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggO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boundary::after {
        content: "An error has occurred."
    }

/* Admin link specific styles */
.nav-links .nav-link.admin-link {
    background: transparent !important;
    color: #1976d2 !important;
    border: 1px solid rgba(25, 118, 210, 0.2) !important;
    font-weight: 600 !important;
    position: relative;
}

.nav-links .nav-link.admin-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.1) 0%, rgba(21, 101, 192, 0.1) 100%);
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.nav-links .nav-link.admin-link:hover {
    background: rgba(25, 118, 210, 0.1) !important;
    color: #1976d2 !important;
    border-color: #1976d2 !important;
    transform: translateY(-0.5px) !important;
    box-shadow: 0 3px 10px rgba(25, 118, 210, 0.2) !important;
}

.nav-links .nav-link.admin-link:hover::before {
    opacity: 1;
}

.nav-links .nav-link.admin-link.active {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3) !important;
    border-color: #1976d2 !important;
}

.admin-icon {
    font-size: 1em;
    margin-right: 0.3rem;
    opacity: 0.8;
}

/* Remove old admin section styles */
.admin-section {
    display: none;
}

.admin-welcome {
    display: none;
}

/* Old global .page-header styles removed in favor of MainLayout .main-content .page-header */

/* Admin page header styles */
.admin-sponsors .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    background: none;
    margin: 0 0 3rem 0;
}

.admin-sponsors .page-header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 300;
    background: linear-gradient(135deg, #64b5f6 0%, #1976d2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .admin-sponsors .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .admin-sponsors .page-header h1 {
        font-size: 2rem;
    }
}

/* Responsive admin link styles */
@media (max-width: 768px) {
    .nav-links .nav-link.admin-link {
        padding: 0.6rem 1rem !important;
    }
}

/* Header Top Navigation Styles */
.header-top {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.1) 0%, rgba(21, 101, 192, 0.05) 100%);
    border-bottom: 1px solid rgba(25, 118, 210, 0.2);
    padding: 1rem 0;
    margin: -2rem -1.5rem 2rem -1.5rem;
}

.header-top .btn {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2);
}

.header-top .btn:hover {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(25, 118, 210, 0.3);
}

.header-top .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2);
}

.header-top .btn i {
    font-size: 1rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .header-top {
        margin: -1.5rem -1rem 1.5rem -1rem;
        padding: 0.75rem 0;
        text-align: center;
    }
    
    .header-top .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Premium content area styles */
.content-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
}

.content-page .updated {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.content-page .editable {
    clear: both;
}

/* Unify content blocks (bylaws/rules/sections) with premium card look */
.content-page .editable .content-section,
.content-page .editable .bylaws-section,
.content-page .editable .rule-section {
    background: var(--surface);
    border: 1px solid #ececec;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem 1.1rem 1.1rem; /* extra left padding to accommodate accent */
    margin: 0.85rem 0 1.1rem 0;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.content-page .editable .content-section::before,
.content-page .editable .bylaws-section::before,
.content-page .editable .rule-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--bfbk-red) 0%, #e23b52 100%);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
    opacity: 0.9;
}

/* Typography inside content blocks */
.content-page .editable .content-section h2,
.content-page .editable .bylaws-section h2,
.content-page .editable .rule-section h2 {
    margin: 0 0 0.35rem 0;
    font-size: 1.35rem;
}

.content-page .editable .content-section p,
.content-page .editable .bylaws-section p,
.content-page .editable .rule-section p {
    color: var(--text-primary);
    margin: 0.35rem 0 0.75rem 0;
}

.content-page .editable .content-section ul,
.content-page .editable .bylaws-section ul,
.content-page .editable .rule-section ul {
    padding-left: 1.15rem;
    margin: 0.35rem 0 0.75rem 0;
}

.content-page .editable .content-section li,
.content-page .editable .bylaws-section li,
.content-page .editable .rule-section li {
    margin: 0.25rem 0;
}

/* Bootstrap cards inside content should match the same premium look */
.content-page .card {
    border-radius: var(--radius-md);
    border-color: #ececec;
    box-shadow: var(--shadow-sm);
}

.content-page .card-header {
    background: var(--surface);
    border-bottom-color: #efefef;
    font-weight: 600;
}

.content-page .card-body {
    padding: 1rem 1.25rem;
    color: var(--text-primary);
}

/* Edit-mode helper styles: subtle highlight while editing */
.content-page .editable.editing {
    outline: 2px dashed rgba(200, 16, 46, 0.6);
    outline-offset: 4px;
    padding: 8px;
    border-radius: 6px;
}

/* Optional style variants (opt-in) */
/* 1) Flat theme: squared corners, reduced shadows, crisp borders */
body.theme-flat {
    --radius-sm: 0px;
    --radius-md: 0px;
    --radius-lg: 0px;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
}

.content-page.flat .editable .content-section,
.content-page.flat .editable .bylaws-section,
.content-page.flat .editable .rule-section,
.content-page.flat .card {
    border-radius: 0 !important;
    box-shadow: none !important;
    border-color: #e5e5e5 !important;
}

.content-page.flat .editable .content-section::before,
.content-page.flat .editable .bylaws-section::before,
.content-page.flat .editable .rule-section::before {
    width: 3px; /* a bit thinner accent */
    background: var(--bfbk-red);
    opacity: 1;
}

/* 2) Minimal theme: remove card look; use separators and spacing */
.content-page.minimal .editable .content-section,
.content-page.minimal .editable .bylaws-section,
.content-page.minimal .editable .rule-section {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0.25rem 0 1rem 0.75rem; /* a touch of left offset for accent */
    position: relative;
}
.content-page.minimal .editable .content-section + .content-section,
.content-page.minimal .editable .bylaws-section + .bylaws-section,
.content-page.minimal .editable .rule-section + .rule-section {
    border-top: 1px solid #ececec; /* subtle divider between blocks */
    padding-top: 1rem;
    margin-top: 1rem;
}
.content-page.minimal .editable .content-section::before,
.content-page.minimal .editable .bylaws-section::before,
.content-page.minimal .editable .rule-section::before {
    width: 2px;
    left: 0;
    background: var(--bfbk-red);
    border-radius: 0;
    opacity: 0.9;
}
.content-page.minimal .card {
    border: 1px solid #efefef;
    border-radius: 6px;
    box-shadow: none;
}
.content-page.minimal .card-header {
    background: transparent;
}

/* Keep inline edit toolbar above surrounding content so it's always clickable */
.content-page .edit-toolbar {
    position: relative;
    z-index: 5;
}
