/*
 * =====================================================
 * Global styles for the TBCC Online Tracking System
 *
 * To unify the look and feel with the main TBCC website, we define
 * a colour palette and typography consistent with the public site.
 * These variables mirror the colours used on truebelieverscc.org,
 * allowing pages within the webapp to automatically adopt the same
 * branding without per‑page adjustments.  The fonts are imported
 * once here rather than inline on each page to avoid duplication.
 */

/* Import custom fonts used on the main website */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Fraunces:wght@700&display=swap');

/* TBCC palette and typography */
:root {
    --tbcc-primary: #003d73;    /* Deep blue for headings and nav bar */
    --tbcc-secondary: #fdebd3;  /* Light peach for subtle backgrounds */
    --tbcc-accent: #e36f23;     /* Warm orange for buttons and highlights */
    --tbcc-dark: #2a2a2a;       /* Neutral dark grey for body text */
    --tbcc-light: #ffffff;      /* Pure white for cards and sections */
    --tbcc-link: #0077b6;       /* Bright blue for links */
    --tbcc-link-hover: #004e86; /* Darker shade on hover */
    --font-family-base: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-family-heading: 'Fraunces', 'Playfair Display', serif;
}

/* General body and container styles */
body, html {
    height: 100%;
    margin: 0;
    font-family: var(--font-family-base);
    overflow-x: hidden; /* Only hide horizontal overflow */
    /* Use existing background image; fallback to a soft TBCC colour */
    background: url('background.png') no-repeat center center fixed, var(--tbcc-secondary) !important;
    background-size: cover !important;
    color: var(--tbcc-dark);
}



/* Content container styling */
.container {
    max-width: 900px;
    margin: 50px auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.9); /* Semi-transparent white background */
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Form labels and text */
label, h1, h2, h3 {
    /* Use TBCC primary colour and strong weight for labels and headings */
    color: var(--tbcc-primary) !important;
    font-weight: bold;
}

input[type="text"], input[type="password"], input[type="date"], select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #f9f9f9;
    color: #333333;
    height: 38px; /* Consistent height for all form controls */
    font-size: 16px;
}

input::placeholder {
    color: #999999; /* Placeholder color for better readability */
}

/* Button styles */
button {
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

button:hover {
    opacity: 0.9;
}

/* Red buttons for Remove and Exit */
.btn-danger,
button[name="exit_activity"] {
    background-color: #dc3545;
    color: #ffffff;
}

.btn-danger:hover,
button[name="exit_activity"]:hover {
    background-color: #b02a37;
}

/* Green button for Add */
.btn-success {
    background-color: #28a745;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #218838;
}

/* Table styles */
.table {
    background: #f9f9f9;
    color: #333333;
    margin-top: 20px;
    border-radius: 5px;
    overflow: hidden;
}

.table th, .table td {
    text-align: center;
    vertical-align: middle;
    padding: 10px;
}

/* Style table headers to align with the TBCC palette */
.table thead {
    background: var(--tbcc-primary);
    color: var(--tbcc-light);
}

/*
 * Component overrides to harmonise Bootstrap elements with the TBCC theme.
 * These rules ensure that navigation bars, buttons and links inherit
 * colours consistent with the main public website.
 */

/* Navigation bar
   Override Bootstrap's .bg-primary to use the TBCC primary colour. */
.bg-primary,
.navbar,
.navbar.navbar-dark {
    background-color: var(--tbcc-primary) !important;
    border-color: var(--tbcc-primary) !important;
}

/* Navbar link colours */
.navbar-nav .nav-link {
    color: var(--tbcc-light) !important;
    font-weight: 600;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--tbcc-accent) !important;
}

/* Primary button
   Uses TBCC accent colour with dark text for contrast. */
.btn-primary {
    background-color: var(--tbcc-accent) !important;
    border-color: var(--tbcc-accent) !important;
    color: var(--tbcc-dark) !important;
    font-weight: 600;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--tbcc-secondary) !important;
    border-color: var(--tbcc-secondary) !important;
    color: var(--tbcc-dark) !important;
}

/* Link colours */
a {
    color: var(--tbcc-link);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}
a:hover,
a:focus {
    color: var(--tbcc-link-hover);
}

/* Heading styles */
h1, h2, h3 {
    color: #333333 !important; /* Dark gray text */
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
    background: none !important; /* Remove any background */
    padding: 10px 0;
    border: none;
}

.page-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.75rem;
    padding: 1.55rem 1.65rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 1rem;
    background:
        linear-gradient(135deg, var(--tbcc-primary) 0%, #005a96 58%, var(--tbcc-accent) 100%);
    box-shadow: 0 1.15rem 2.65rem rgba(0, 61, 115, 0.24);
}

.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    width: auto;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 32%),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 34%);
    pointer-events: none;
}

.page-hero::after {
    content: "";
    position: absolute;
    right: -3.5rem;
    top: -4rem;
    width: 10rem;
    height: 10rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

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

.page-hero-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.35rem;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-hero-title {
    margin: 0;
    padding: 0;
    border: 0;
    background: none !important;
    color: #ffffff !important;
    text-align: left !important;
    font-family: var(--font-family-heading);
    font-size: clamp(1.75rem, 3vw, 2.55rem);
    line-height: 1.08;
}

.page-hero-subtitle {
    margin: 0.45rem 0 0;
    max-width: 54rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.45;
}

.page-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.page-hero .badge {
    box-shadow: 0 0.45rem 1rem rgba(0, 61, 115, 0.16);
}

.page-hero .btn-outline-primary,
.page-hero .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.68);
    color: #ffffff;
}

.page-hero .btn-outline-primary:hover,
.page-hero .btn-outline-secondary:hover,
.page-hero .btn-outline-primary:focus,
.page-hero .btn-outline-secondary:focus {
    background: #ffffff;
    color: var(--tbcc-primary);
}

.section-heading {
    margin: 1.5rem 0 1rem;
    padding: 0;
    color: var(--tbcc-primary) !important;
    text-align: left;
    font-family: var(--font-family-heading);
    font-size: 1.45rem;
    line-height: 1.15;
}

@media (max-width: 767.98px) {
    .page-hero {
        padding: 1.15rem 1.1rem;
    }

    .page-hero-title,
    .page-hero-subtitle {
        text-align: left;
    }

    .page-hero-actions {
        justify-content: flex-start;
        margin-top: 1rem;
    }
}

form .form-group.row .btn-primary {
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    height: 38px; /* Ensure it matches the height of the date input fields */
}

#totalChart, #ageChart {
    height: 600px;
}
