/**
 * Main CSS - Common styles across all pages
 * Includes fonts, navbar, forms, buttons, alerts, modals, and general layout
 */

/* CSS Custom Properties */
:root {
    --color-primary: rgb(28, 105, 212);
    --color-primary-light: rgb(236, 245, 255);
    --color-bg-light: #f5f7fa;
    --color-border: #e0e6ed;
    /* Responsive breakpoints (reference only — CSS can't use vars in media queries) */
    /* --bp-tablet: 1024px */
    /* --bp-mobile-lg: 768px */
    /* --bp-mobile: 480px  */
}

/* Font Faces */
@font-face {
	font-family: 'BMWTypeNext-Regular';
	src: url('../fonts/eot/BMWTypeNextTT-Regular.eot');
	src: url('../fonts/eot/BMWTypeNextTT-Regular.eot?#iefix') format('embedded-opentype'), url('../fonts/woff2/BMWTypeNext-Regular.woff2') format('woff2'), url('../fonts/woff/BMWTypeNextTT-Regular.woff') format('woff'), url('../fonts/ttf/BMWTypeNextTT-Regular.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
}
@font-face {
	font-family: 'BMWTypeNext-Light';
	src: url('../fonts/eot/BMWTypeNextTT-Light.eot');
	src: url('../fonts/eot/BMWTypeNextTT-Light.eot?#iefix') format('embedded-opentype'), url('../fonts/woff2/BMWTypeNext-Light.woff2') format('woff2'), url('../fonts/woff/BMWTypeNextTT-Light.woff') format('woff'), url('../fonts/ttf/BMWTypeNextTT-Light.ttf') format('truetype');
	font-weight: lighter;
	font-style: normal;
}
@font-face {
	font-family: 'BMWTypeNext-Thin';
	src: url('../fonts/eot/BMWTypeNextTT-Thin.eot');
	src: url('../fonts/eot/BMWTypeNextTT-Thin.eot?#iefix') format('embedded-opentype'), url('../fonts/woff2/BMWTypeNext-Thin.woff2') format('woff2'), url('../fonts/woff/BMWTypeNextTT-Thin.woff') format('woff'), url('../fonts/ttf/BMWTypeNextTT-Thin.ttf') format('truetype');
	font-weight: lighter;
	font-style: normal;
}
@font-face {
	font-family: 'BMWTypeNext-Bold';
	src: url('../fonts/eot/BMWTypeNextTT-Bold.eot');
	src: url('../fonts/eot/BMWTypeNextTT-Bold.eot?#iefix') format('embedded-opentype'), url('../fonts/woff2/BMWTypeNext-Bold.woff2') format('woff2'), url('../fonts/woff/BMWTypeNextTT-Bold.woff') format('woff'), url('../fonts/ttf/BMWTypeNextTT-Bold.ttf') format('truetype');
	font-weight: bold;
	font-style: normal;
}

 /*PRE-STYLING - START*/
/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */

html {
    font-family: 'BMWTypeNext-Regular', sans-serif;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--color-bg-light);
    color: #333;
    line-height: 1.6;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
main,
menu,
nav,
section,
summary {
    display: block
}

audio,
canvas,
progress,
video {
    display: inline-block
}

audio:not([controls]) {
    display: none;
    height: 0
}

progress {
    vertical-align: baseline
}

template,
[hidden] {
    display: none
}

a {
    text-decoration: none;
    background-color: transparent;
    color: var(--color-primary);
}

a:active,
a:hover {
    outline-width: 0
}

abbr[title] {
    border-bottom: 0;
    text-decoration: underline;
    text-decoration: underline dotted
}

b,
strong {
    font-weight: inherit
}

b,
strong {
    font-weight: bolder
}

dfn {
    font-style: italic
}

h1 {
    font-size: 2em;
    margin: .67em 0
}

mark {
    background-color: #ff0;
    color: #000
}

small {
    font-size: 80%
}

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline
}

sub {
    bottom: -0.25em
}

sup {
    top: -0.5em
}

img {
    border-style: none
}

svg:not(:root) {
    overflow: hidden
}

code,
kbd,
pre,
samp {
    font-family: monospace, monospace;
    font-size: 1em
}

figure {
    margin: 1em 40px
}

hr {
    box-sizing: content-box;
    height: 0;
    overflow: visible
}

button,
input,
select,
textarea {
    font: inherit;
    margin: 0
}

optgroup {
    font-weight: bold
}

button,
input {
    overflow: visible
}

button,
select {
    text-transform: none
}

button,
html [type="button"],
[type="reset"],
[type="submit"] {
    -webkit-appearance: button;
    -moz-appearance: button;
    appearance: button
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
    border-style: none;
    padding: 0
}

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
    outline: 1px dotted ButtonText
}

fieldset {
    border: 1px solid silver;
    margin: 0 2px;
    padding: .35em .625em .75em
}

legend {
    box-sizing: border-box;
    color: inherit;
    display: table;
    max-width: 100%;
    padding: 0;
    white-space: normal
}

textarea {
    overflow: auto
}

[type="checkbox"],
[type="radio"] {
    box-sizing: border-box;
    padding: 0
}

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
    height: auto
}

[type="search"] {
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
    outline-offset: -2px
}

[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

::-webkit-input-placeholder {
    color: inherit;
    opacity: .54
}

::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit;
}

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

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-light);
}

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

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/*PRE-STYLING - END*/

/* ============================================
   Navbar Styles
   ============================================ */
.navbar {
    background: white;
    border-bottom: 1px solid var(--color-border);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar h1 {
    font-size: 24px;
    color: #2c3e50;
    font-weight: 600;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.navbar-links a:hover {
    color: var(--color-primary);
}

.navbar-links a.nav-active {
    color: var(--color-primary);
    font-weight: 600;
}

/* Account Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    transition: color 0.3s;
}

.nav-dropdown-toggle:hover {
    color: var(--color-primary);
}

.dropdown-arrow {
    font-size: 11px;
    margin-left: 2px;
    display: inline-block;
    transition: transform 0.3s;
}

.nav-dropdown.open > .nav-dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 8px;
    min-width: 150px;
    z-index: 1000;
}

.nav-dropdown-menu-inner {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu.show {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #333 !important;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.nav-dropdown-menu a:hover {
    background: var(--color-bg-light);
    color: var(--color-primary) !important;
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 4px 0;
}

/* Hamburger Button */
.navbar-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    gap: 6px;
    border-radius: 6px;
    transition: background 0.2s;
}

.navbar-hamburger:hover {
    background: var(--color-bg-light);
}

.navbar-hamburger:active {
    background: var(--color-border);
}

.navbar-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #666;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.navbar-hamburger:hover span {
    background: var(--color-primary);
}

.navbar-hamburger.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.navbar-hamburger.open span:nth-child(2) {
    opacity: 0;
}

.navbar-hamburger.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ============================================
   Layout & Container
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.container-narrow {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
}

/* ============================================
   Cards & Panels
   ============================================ */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.profile-card {
    background: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Headers & Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5em;
    color: #2c3e50;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

.profile-header {
    margin-bottom: 30px;
}

.profile-header h1 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.profile-header p {
    color: #666;
    font-size: 14px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    /* justify-content: center; */
}

.form-group-inline input[type="checkbox"] {
    width: auto;
}

.form-group-inline label {
    margin: 0;
}

.form-hint {
    color: #999;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

.text-capitalize {
    text-transform: capitalize;
}

.read-only-group {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid var(--color-primary);
}

.read-only-group label {
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.read-only-group .value {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.password-hint {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

.section-divider {
    margin: 20px 0 0 0;
    padding: 15px 0 0 0;
    border-top: 1px solid var(--color-border);
}

/* ============================================
   Button Styles
   ============================================ */

button, .btn {
    cursor: pointer;
    font-family: 'BMWTypeNext-Bold', sans-serif;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
    background-color: var(--color-primary);
    border: none;
    border-radius: 3px;
    padding: 10px 20px;
    margin: 5px 0px;
    width: 100%;
    max-width: 400px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    white-space: nowrap;
}

button:hover {
    background-color: rgb(6, 83, 182);
}

.btn-primary, button.active {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover, button.active:hover {
    background: rgb(6, 83, 182);
}

.btn-secondary {
    background-color: transparent;
    color: #000;
    border: #000 1px solid;
}

.btn-secondary:hover {
    background-color: #000;
    color: #fff;
    border: #000 1px solid;
}

.btn-create {
    background: #28a745;
    color: white;
}

.btn-create:hover {
    background: #218838;
}

.btn-delete, .btn-danger {
    background-color: transparent;
    color: #e74c3c;
    border:  #e74c3c 1px solid;
}

.btn-delete:hover, .btn-danger:hover {
    background-color: #e74c3c;
    color: white;
}

.btn-small {
    padding: 8px 12px;
    font-size: 13px;
}

button:disabled,
button[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-no-width {
    width: auto;
    max-width: none;
}

/* ============================================
   Alert & Notification Styles
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.info-box {
    background: #f0f4ff;
    border: 1px solid #d4e4ff;
    border-radius: 6px;
    padding: 12px;
    color: var(--color-primary);
    font-size: 13px;
    margin-bottom: 20px;
}

/* ============================================
   Badge Styles
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 11px; 
    margin-right: 8px;
    font-weight: 600;
    background: #f0f0f0;
    color: #666;
}

.badge.admin {
    background: #f8d7da;
    color: #721c24;
}

.badge.contributor {
    background: #fff3cd;
    color: #856404;
}

.badge.user {
    background: #d1ecf1;
    color: #0c5460;
}

.badge.active {
    background: #d4edda;
    color: #155724;
}

.badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Modal styles consolidated into modal.css */

/* ============================================
   Page Header
   ============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 32px;
    color: #2c3e50;
}

/* ============================================
   Required field indicator
   ============================================ */
.required {
    color: #e74c3c;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center {
    text-align: center;
}

.text-muted {
    color: #999;
}

.text-danger {
    color: #e74c3c;
}

.empty-state {
    text-align: center;
    padding: 20px;
    color: #999;
}

.hide {
    display: none !important;
}

.mt-20 {
    margin-top: 20px;
}

.p-20 {
    padding: 20px;
}

.flex {
    display: flex;
}

/* Form buttons row (profile, etc.) */
.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.form-buttons .btn {
    flex: 1;
}

.flex-row {
    display: flex;
    flex-flow: row;
    align-items: center;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.no-gap {
    gap: unset;
}

.gap-8 {
    gap: 8px;
}

/* ============================================
   Global Responsive Utilities
   ============================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .navbar {
        flex-wrap: wrap;
    }

    .navbar h1 {
        font-size: 20px;
    }

    .navbar-hamburger {
        display: flex;
        min-width: 44px;
        min-height: 44px;
    }

    .navbar-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-top: 10px;
    }

    .navbar-links.navbar-open,
    .navbar-links.navbar-links-visible {
        display: flex;
    }

    .navbar-links.navbar-links-visible {
        width: auto;
        flex-direction: row;
        padding-top: 0;
    }

    .navbar-links > a,
    .navbar-links > .nav-dropdown {
        padding: 10px 0;
        border-top: 1px solid var(--color-border);
    }

    .nav-dropdown {
        flex-direction: column;
        width: 100%;
    }

    /* Disable hover-based dropdowns on mobile */
    .nav-dropdown:hover .nav-dropdown-menu {
        display: none;
    }

    /* Click-to-toggle with slide animation */
    .nav-dropdown.open > .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-menu {
        position: static;
        padding-top: 0;
        min-width: 0;
        width: 100%;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease;
    }

    .nav-dropdown.open > .nav-dropdown-menu {
        max-height: 300px;
    }

    .nav-dropdown-menu-inner {
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.03);
    }

    .nav-dropdown-menu a {
        padding: 10px 10px 10px 24px;
    }

    .nav-dropdown-toggle {
        width: 100%;
        text-align: left;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .button-group {
        flex-direction: column;
    }

    .form-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .navbar h1 {
        font-size: 16px;
    }

    .container {
        padding: 12px;
    }

    .profile-card {
        padding: 20px;
    }
}
