/**
 * Club CMS - Main Stylesheet
 * Uses CSS custom properties for easy theming
 */

/* Accessibility: Skip to main content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color, #2563eb);
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 100000;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--primary-color, #2563eb);
    outline-offset: 2px;
}

/* Accessibility: Focus styles for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--primary-color, #2563eb);
    outline-offset: 2px;
}

/* CSS Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Styles */
html {
    font-size: var(--font-size-base, 16px);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body, 'Open Sans', sans-serif);
    font-size: 1rem; /* Inherits from html which uses --font-size-base */
    font-weight: var(--body-weight, 400);
    color: var(--text-color, #1f2937);
    background-color: var(--background-color, #ffffff);
    line-height: var(--line-height, 1.6);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-weight: var(--heading-weight, 700);
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 { font-size: var(--font-size-h1, 2.5rem); }
h2 { font-size: var(--font-size-h2, 2rem); }
h3 { font-size: var(--font-size-h3, 1.75rem); }
h4 { font-size: var(--font-size-h4, 1.5rem); }

p {
    margin-bottom: 1em;
}

a {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:where(:hover) {
    color: var(--secondary-color, #1e40af);
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header / Navigation */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--header-bg-color, #1f2937);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.site-header.transparent {
    background-color: transparent;
}

.site-header.transparent.scrolled {
    background-color: var(--header-bg-color, #1f2937);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--header-text-color, #ffffff);
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-weight: var(--heading-weight, 700);
    font-size: var(--site-title-font-size, 1.5rem);
    text-decoration: none;
}

.site-logo img {
    height: 40px;
    width: auto;
}

.site-logo .favicon {
    height: 32px;
    width: 32px;
    object-fit: contain;
}

.site-logo .site-logo-img {
    height: 40px;
    max-width: 150px;
    width: auto;
    object-fit: contain;
}

/* Homepage logo - hidden until scroll */
.site-logo.homepage-logo {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.site-header.scrolled .site-logo.homepage-logo {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.main-nav a {
    color: var(--header-text-color, #ffffff);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: var(--menu-font-size, 0.95rem);
    text-transform: var(--menu-text-transform, none);
    transition: background-color 0.2s ease;
    line-height: 1.2;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.main-nav .nav-label {
    color: var(--header-text-color, #ffffff);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: var(--menu-font-size, 0.95rem);
    line-height: 1.2;
    text-transform: var(--menu-text-transform, none);
    cursor: default;
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav .nav-label.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.main-nav .btn-login {
    background-color: var(--button-bg-color, var(--primary-color, #2563eb));
    color: var(--button-text-color, #ffffff);
    margin-left: 10px;
}

.main-nav .btn-login:hover {
    background-color: var(--button-hover-bg-color, var(--secondary-color, #1e40af));
}

.nav-messages {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px;
    color: var(--header-text-color, #ffffff);
    margin-left: 5px;
}

.nav-messages:hover {
    opacity: 0.8;
}

.nav-messages svg {
    display: block;
}

.message-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.nav-orders {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px;
    color: var(--header-text-color, #ffffff);
    margin-left: 5px;
}

.nav-orders:hover {
    opacity: 0.8;
}

.nav-orders svg {
    display: block;
}

.order-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #f59e0b;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.nav-race-subs {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px;
    color: var(--header-text-color, #ffffff);
    margin-left: 5px;
}

.nav-race-subs:hover {
    opacity: 0.8;
}

.nav-race-subs svg {
    display: block;
}

.race-sub-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #0891b2;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--header-bg-color, #1e293b);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--header-text-color, #ffffff);
    border-radius: 0;
    white-space: nowrap;
    line-height: 1.2;
    text-transform: var(--submenu-text-transform, var(--menu-text-transform, none));
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    cursor: pointer;
    background: none;
    border: none;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--header-text-color, #ffffff);
    border-radius: 2px;
    transition: transform 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    height: var(--hero-height, 400px);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, var(--hero-overlay-opacity, 0.5));
}

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

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-tagline {
    font-size: clamp(1rem, 2vw, 1.5rem);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    position: relative;
    height: var(--page-header-height, 300px);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    margin-top: 70px;
    padding: 40px 20px 60px;
    overflow: hidden;
}

.page-header-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, var(--hero-overlay-opacity, 0.5));
}

.page-header-content {
    position: relative;
    z-index: 1;
    padding: 20px;
}

.page-header-title {
    font-size: clamp(2rem, 4vw, 3rem);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Page Container with footer background */
.page-container {
    background-color: var(--footer-bg-color, #1f2937);
    flex: 1;
    padding-bottom: 40px;
}

/* Page Header Banner (used by PageHeader class) */
.page-header-banner {
    margin-top: 70px;
    position: relative;
    z-index: 1;
}

/* Admin/Editor page header - uses separate height setting */
.page-header-admin {
    min-height: var(--page-header-height-admin, 200px) !important;
}

/* Page Content Card - overlaps header with semi-transparent background */
.page-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 24px;
    margin: -30px 20px 0 20px;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    min-height: 300px;
}

.page-content-inner {
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
    padding: 50px 40px 60px;
}

/* Narrower content for text-heavy pages */
.page-content-inner.narrow {
    max-width: 800px;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 15px 0;
    font-size: 0.875rem;
}

.breadcrumbs a {
    color: var(--text-color, #1f2937);
    opacity: 0.7;
}

.breadcrumbs a:hover {
    opacity: 1;
}

.breadcrumbs span {
    margin: 0 8px;
    opacity: 0.5;
}

/* Main Content */
main {
    flex: 1;
    padding: 40px 0;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.card-body {
    padding: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--button-bg-color, var(--primary-color, #2563eb));
    color: var(--button-text-color, #ffffff);
}

.btn-primary:hover {
    background-color: var(--button-hover-bg-color, var(--secondary-color, #1e40af));
    color: var(--button-text-color, #ffffff);
}

.btn-secondary {
    background-color: var(--secondary-color, #1e40af);
    color: #ffffff;
}

.btn-outline {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background: #f3f4f6;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: none;
}

.btn-danger:hover {
    background: #fecaca;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-color, #374151);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Footer */
.site-footer {
    background-color: var(--footer-bg-color, #1f2937);
    color: var(--footer-text-color, #ffffff);
    padding: 20px 0;
}

.footer-content {
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 1.125rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul a {
    color: var(--footer-text-color, #ffffff);
    opacity: 0.8;
}

.footer-section ul a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    opacity: 0.8;
}

.footer-bottom p {
    margin: 0;
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--footer-text-color, #ffffff);
    transition: background-color 0.2s ease;
}

.social-icons a:hover {
    background-color: var(--primary-color, #2563eb);
}

/* Login Modal / Page */
.auth-container {
    max-width: 400px;
    margin: 80px auto 40px;
    padding: 30px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 25px;
}

/* Members Area */
.members-dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    margin-top: 90px;
    min-height: calc(100vh - 90px);
}

.members-sidebar {
    background: #f8fafc;
    padding: 20px;
    border-right: 1px solid #e2e8f0;
}

.members-sidebar nav a {
    display: block;
    padding: 12px 16px;
    color: var(--text-color, #1f2937);
    border-radius: 8px;
    margin-bottom: 5px;
}

.members-sidebar nav a:hover,
.members-sidebar nav a.active {
    background-color: var(--primary-color, #2563eb);
    color: #ffffff;
}

.members-content {
    padding: 30px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.hidden { display: none !important; }

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-draft { background: #f3f4f6; color: #6b7280; }
.badge-public { background: #dbeafe; color: #1e40af; }
.badge-physical { background: #dbeafe; color: #1e40af; }
.badge-ticket { background: #fef3c7; color: #92400e; }
.badge-membership { background: #dcfce7; color: #166534; }
.badge-coaching { background: #f3e8ff; color: #6b21a8; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-unpaid { background: #fee2e2; color: #991b1b; }
.badge-refunded { background: #f3f4f6; color: #6b7280; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f3f4f6; color: #6b7280; }

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 700px;
}

.modal-content h3 {
    margin: 0 0 20px 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.data-table th {
    font-weight: 600;
    color: #374151;
    font-size: 0.85rem;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.data-table tr:hover {
    background: #f9fafb;
}

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

/* Make data tables scrollable on mobile */
.data-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Admin Layout */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-color, #2563eb);
}

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

.empty-state svg {
    width: 80px;
    height: 80px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin: 0 0 10px;
    color: #374151;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 20px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="search"],
.filter-bar input[type="date"],
.filter-bar input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Filter bar grid layout for labelled fields */
.filter-bar-grid {
    display: grid;
    gap: 12px;
    align-items: end;
}

.filter-field {
    min-width: 0;
}

.filter-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
}

.filter-field .form-control {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.85rem;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.filter-actions .filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 400;
    font-size: 0.85rem;
    color: #374151;
}

.filter-actions .filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color, #2563eb);
}

.filter-actions .filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-actions .filter-count {
    color: #6b7280;
    font-size: 0.85rem;
    margin-left: auto;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: var(--heading-weight, 700);
    font-family: var(--font-heading, sans-serif);
    color: var(--text-color, #1f2937);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-value.warning { color: #f59e0b; }
.stat-value.danger { color: #dc2626; }
.stat-value.good { color: #16a34a; }

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

/* Stock Status */
.stock-status { font-size: 0.9rem; }
.stock-status.in-stock { color: #16a34a; }
.stock-status.low-stock { color: #f59e0b; }
.stock-status.out-of-stock { color: #dc2626; }

/* Text helpers */
.text-muted { color: #6b7280; }

/* Actions row */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

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

/* Back to Dashboard Link */
.back-to-dashboard {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.back-to-dashboard:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--header-bg-color, #1f2937);
        flex-direction: column;
        padding: 20px;
        display: none;
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .main-nav a {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
    
    /* Mobile dropdown styles */
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-dropdown-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 6px;
        margin: 5px 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding: 0;
    }
    
    .nav-dropdown.open .nav-dropdown-menu {
        max-height: 500px;
        padding: 8px 0;
    }
    
    .nav-dropdown-menu a {
        padding: 10px 20px;
    }
    
    .hero {
        height: 60vh;
    }
    
    .page-header {
        min-height: 280px;
        padding: 35px 20px 50px;
    }
    
    .page-header-banner {
        padding: 35px 20px 50px !important;
    }

    .page-header-admin {
        padding: 25px 20px 35px !important;
    }

    .page-content {
        border-radius: 20px;
        margin-top: -30px;
        margin-left: 15px;
        margin-right: 15px;
    }

    .page-content-inner {
        padding: 35px 25px 50px;
    }
    
    .page-container {
        padding-bottom: 30px;
    }
    
    .members-dashboard {
        grid-template-columns: 1fr;
    }
    
    .members-sidebar {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        padding: 16px 18px;
    }

    .data-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar select,
    .filter-bar input {
        width: 100%;
    }

    .filter-bar-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .filter-field-wide {
        grid-column: 1 / -1;
    }

    .filter-actions {
        flex-wrap: wrap;
    }

    .modal-content {
        max-width: 95vw;
        padding: 18px;
    }

    .modal-large {
        max-width: 95vw;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .page-header-title {
        font-size: 1.75rem;
    }
    
    .page-header {
        min-height: 250px;
        padding: 30px 15px 45px;
    }
    
    .page-header-banner {
        padding: 30px 15px 45px !important;
    }

    .page-header-admin {
        padding: 20px 15px 30px !important;
    }

    .page-content {
        border-radius: 16px;
        margin-top: -30px;
        margin-left: 10px;
        margin-right: 10px;
    }
    
    .page-content-inner {
        padding: 25px 20px 40px;
    }
    
    .page-container {
        padding-bottom: 25px;
    }
    
    .auth-container {
        margin: 70px 15px 30px;
        padding: 20px;
    }

    .filter-bar-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   Floating Page Hints
   Dismissible help tooltips for pages
   ========================================== */

.page-hint-trigger {
    position: fixed !important;
    bottom: 100px !important;
    right: 30px !important;
    z-index: 9998 !important;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color, #2563eb);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    font-size: 1.2rem;
    font-weight: bold;
}

.page-hint-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.page-hint-trigger.active {
    background: var(--secondary-color, #1e40af);
}

.page-hint-panel {
    position: fixed !important;
    bottom: 155px !important;
    right: 30px !important;
    z-index: 9997 !important;
    width: 320px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.page-hint-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.page-hint-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--primary-color, #2563eb);
    color: white;
    border-radius: 12px 12px 0 0;
}

.page-hint-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-hint-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.page-hint-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.page-hint-body {
    padding: 16px;
}

.page-hint-body ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-hint-body li {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.5;
}

.page-hint-body li:last-child {
    border-bottom: none;
}

.page-hint-body li strong {
    color: var(--primary-color, #2563eb);
}

.page-hint-footer {
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
    text-align: center;
}

.page-hint-dismiss {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
}

.page-hint-dismiss:hover {
    color: #374151;
    text-decoration: underline;
}

/* Hide trigger if hints disabled or dismissed for session */
.page-hint-trigger.hidden {
    display: none;
}

@media (max-width: 480px) {
    .page-hint-trigger {
        bottom: 90px !important;
        right: 20px !important;
        width: 40px;
        height: 40px;
    }

    .page-hint-panel {
        bottom: 140px !important;
        right: 15px !important;
        left: 15px !important;
        width: auto;
    }
}
