/* Jo Jingles Brand Fonts */
@font-face { 
    font-family: 'Bariol'; 
    src: url('/static/fonts/bariol_regular-webfont.ttf') format('truetype'); 
    font-weight: normal; 
    font-style: normal; 
}
@font-face { 
    font-family: 'Bariol'; 
    src: url('/static/fonts/bariol_bold-webfont.ttf') format('truetype'); 
    font-weight: bold; 
    font-style: normal; 
}
@font-face { 
    font-family: 'Bariol'; 
    src: url('/static/fonts/bariol_light-webfont.ttf') format('truetype'); 
    font-weight: 300; 
    font-style: normal; 
}

/* Jo Jingles Brand Colors */
:root {
    --jj-red: #E53935;
    --jj-red-dark: #C62828;
    --jj-red-light: #EF5350;
    --jj-yellow: #FDD835;
    --jj-yellow-dark: #F9A825;
    --jj-blue: #1E88E5;
    --jj-blue-dark: #1565C0;
    --jj-green: #43A047;
    --jj-orange: #FB8C00;
    --jj-purple: #8E24AA;
    --jj-pink: #E91E63;
    --jj-gray: #757575;
    --jj-gray-light: #EEEEEE;
    --jj-white: #FFFFFF;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body { 
    font-family: 'Bariol', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; 
    background: linear-gradient(135deg, var(--jj-red) 0%, var(--jj-yellow) 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
}

/* Navigation Header */
.jj-navbar { 
    background: #ef1c22;
    padding: 1rem 0;
    box-shadow: 0 10px 24px rgba(92, 12, 12, 0.16);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.jj-navbar .container {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.jj-navbar .navbar-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--jj-white) !important;
    text-decoration: none;
}

.jj-navbar .navbar-brand img {
    height: 74px;
    width: auto;
}

.jj-nav-menu {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: auto;
    min-width: 0;
}

.jj-nav-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.jj-nav-links li {
    display: flex;
}

.jj-nav-links a {
    color: var(--jj-white);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.2rem;
    font-weight: 700;
    transition: color 0.25s ease, opacity 0.25s ease, border-color 0.25s ease;
    font-size: 0.95rem;
    line-height: 1.1;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.jj-nav-links a:hover {
    opacity: 1;
}

.jj-nav-links-primary a:hover,
.jj-nav-links-primary a:focus-visible {
    color: var(--jj-yellow);
    border-color: rgba(253, 216, 53, 0.8);
}

.jj-nav-links-secondary {
    gap: 1rem;
    padding-left: 1.35rem;
    margin-left: 0.35rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.jj-nav-links-secondary a {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.88rem;
    font-weight: 600;
}

.jj-nav-links-secondary a:hover,
.jj-nav-links-secondary a:focus-visible {
    color: var(--jj-yellow);
    border-color: rgba(253, 216, 53, 0.75);
}

.jj-nav-cta {
    background: var(--jj-yellow);
    color: var(--jj-red) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.95rem 1.5rem;
    border-radius: 999px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(122, 64, 0, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.jj-nav-cta:hover {
    background: var(--jj-yellow-dark);
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(122, 64, 0, 0.22);
    opacity: 1;
}

.jj-nav-cta-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
}

.jj-nav-cta-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: var(--jj-white);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    z-index: 1001;
    position: relative;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.mobile-nav-toggle:focus {
    outline: none;
}

.mobile-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.mobile-nav-toggle-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: background-color 0.25s ease;
}

.mobile-nav-toggle-icon::before,
.mobile-nav-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    background: currentColor;
    border-radius: 999px;
    transition: top 0.25s ease, transform 0.25s ease;
}

.mobile-nav-toggle-icon::before {
    top: -6px;
}

.mobile-nav-toggle-icon::after {
    top: 6px;
}

.mobile-nav-toggle.active .mobile-nav-toggle-icon {
    background: transparent;
}

.mobile-nav-toggle.active .mobile-nav-toggle-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-nav-toggle.active .mobile-nav-toggle-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

@media (max-width: 1180px) {
    .jj-navbar .container {
        max-width: 100%;
        gap: 1rem;
    }

    .jj-nav-menu {
        gap: 0.75rem;
    }

    .jj-nav-links a {
        font-size: 0.88rem;
        padding: 0.5rem 0.1rem;
    }

    .jj-nav-links-secondary {
        padding-left: 0.75rem;
    }

    .jj-nav-cta {
        padding: 0.65rem 1.05rem;
        font-size: 0.92rem;
    }
}

/* Mobile Navigation Styles */
@media (max-width: 960px) {
    .jj-navbar {
        padding: 0.75rem 0;
    }
    
    .jj-navbar .container {
        padding: 0 1rem;
        gap: 0.75rem;
    }
    
    .jj-navbar .navbar-brand {
        font-size: 1.35rem;
    }
    
    .jj-navbar .navbar-brand img {
        height: 54px;
    }
    
    .mobile-nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }
    
    .jj-nav-menu {
        position: fixed;
        top: 92px;
        left: 1rem;
        right: 1rem;
        background: rgba(239, 28, 34, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 24px;
        box-shadow: 0 24px 48px rgba(83, 20, 14, 0.28);
        flex-direction: column;
        align-items: stretch;
        gap: 0.9rem;
        padding: 1rem;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-12px);
        transition: opacity 0.25s ease, transform 0.25s ease;
        z-index: 1000;
    }
    
    .jj-nav-menu.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .jj-nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }
    
    .jj-nav-links li {
        width: 100%;
    }
    
    .jj-nav-links a {
        justify-content: flex-start;
        font-size: 1.05rem;
        padding: 0.95rem 1rem;
        background: rgba(255, 255, 255, 0.08);
        width: 100%;
        border-bottom: none;
        border-radius: 16px;
    }
    
    .jj-nav-links-secondary {
        padding-left: 0;
        padding-top: 0.9rem;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    .jj-nav-cta {
        width: 100%;
        padding: 0.95rem 1.2rem !important;
        font-size: 1rem !important;
    }

    body.jj-nav-open {
        overflow: hidden;
    }
}

/* Main Content Areas */
.main-content { 
    background: var(--jj-white);
    border-radius: 0;
    padding: 0;
    margin: 0;
    min-height: calc(100vh - 80px);
}

/* Discover Footer */
.jj-footer {
    background: #ef1c22;
    color: var(--jj-white);
    padding: 4.5rem 1.5rem 2rem;
}

.jj-footer-main {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.9fr) minmax(220px, 0.8fr);
    gap: 3rem;
    align-items: start;
}

.jj-footer-brand img {
    width: 150px;
    height: auto;
    display: block;
    margin-bottom: 1.5rem;
}

.jj-footer-brand p {
    margin: 0;
    max-width: 300px;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--jj-white);
}

.jj-footer-links h3,
.jj-footer-socials h3 {
    margin: 0 0 1.35rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--jj-white);
}

.jj-footer-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.8rem;
}

.jj-footer-links a,
.jj-footer-bottom a {
    color: var(--jj-white);
    text-decoration: none;
    font-weight: 700;
}

.jj-footer-links a:hover,
.jj-footer-bottom a:hover {
    color: var(--jj-yellow);
}

.jj-footer-social-list {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.jj-footer-social-list a {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f9a825;
    color: var(--jj-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.jj-footer-social-list a:hover {
    background: #ffbf2f;
    transform: translateY(-2px);
}

.jj-footer-social-list span {
    font-size: 1.8rem;
    line-height: 1;
    font-weight: 700;
    transform: translateY(-1px);
}

.jj-footer-social-list svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.jj-footer-bottom {
    max-width: 1240px;
    margin: 3rem auto 0;
    padding-top: 1.75rem;
    border-top: 2px solid rgba(255, 255, 255, 0.84);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 0.98rem;
    text-transform: uppercase;
}

.jj-footer-bottom span {
    opacity: 0.85;
}

@media (max-width: 960px) {
    .jj-footer {
        padding: 3rem 1.25rem 1.75rem;
    }

    .jj-footer-main {
        grid-template-columns: 1fr;
        gap: 2.25rem;
    }

    .jj-footer-links h3,
    .jj-footer-socials h3 {
        font-size: 1.6rem;
    }

    .jj-footer-brand p {
        font-size: 1.15rem;
        max-width: none;
    }

    .jj-footer-bottom {
        justify-content: flex-start;
        font-size: 0.86rem;
    }
}

.hero-section {
    background: var(--jj-red);
    background-image: url('/static/images/backgrounds/red.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--jj-white);
    text-align: center;
    padding: 4rem 1rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/static/images/brand_images/red, blue, yellow wave.png') no-repeat center center;
    background-size: cover;
    opacity: 0.1;
    z-index: 0;
}

.hero-section .container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Territory Hero Section */
.territory-hero {
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
    background-image: url('/static/images/backgrounds/red.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 4rem 1rem 5rem;
    position: relative;
    overflow: hidden;
}

.territory-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

.territory-hero-content {
    max-width: 1180px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.territory-hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
    gap: 2rem;
    align-items: stretch;
}

.territory-welcome-panel {
    text-align: left;
    align-self: center;
}

.territory-kicker {
    font-size: 0.95rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255,255,255,0.78);
    margin-bottom: 1rem;
}

.territory-contact-panel {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.24);
    border-radius: 28px;
    padding: 1.75rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 45px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.territory-contact-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.territory-contact-header img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    flex-shrink: 0;
}

.territory-contact-copy {
    text-align: left;
}

.territory-contact-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.72);
}

.territory-contact-copy h2 {
    color: var(--jj-white);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
}

.territory-contact-location {
    color: rgba(255,255,255,0.82);
    font-size: 1rem;
    margin: 0.5rem 0 0;
}

.territory-contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.territory-contact-row {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.12);
    text-decoration: none;
    transition: background 0.25s ease, transform 0.25s ease;
}

.territory-contact-row:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
    text-decoration: none;
}

.territory-contact-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.72);
    font-weight: 700;
}

.territory-contact-value {
    color: var(--jj-white);
    font-size: 1rem;
    font-weight: 600;
    word-break: break-word;
}

.territory-socials {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.territory-social-link {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.16);
    color: var(--jj-white);
    transition: background 0.25s ease, transform 0.25s ease;
}

.territory-social-link:hover {
    background: rgba(255,255,255,0.28);
    color: var(--jj-white);
    transform: translateY(-2px);
}

.territory-social-link svg {
    width: 22px;
    height: 22px;
}

.territory-contact-cta {
    width: 100%;
    background: var(--jj-white);
    color: var(--jj-red);
    border: 2px solid var(--jj-white);
}

.territory-contact-cta:hover {
    background: rgba(255,255,255,0.9);
    color: var(--jj-red);
}

.territory-hero-actions .territory-hero-outline-button {
    background: #43A047;
    color: #ffffff;
    border: 2px solid #43A047;
    box-shadow: 0 2px 10px rgba(67, 160, 71, 0.3);
}

.territory-hero-actions .territory-hero-outline-button:hover {
    background: #2E7D32;
    color: #ffffff;
    border-color: #2E7D32;
    box-shadow: 0 6px 20px rgba(67, 160, 71, 0.4);
}

.territory-hero-content h1 {
    font-family: 'Bariol', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--jj-white);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.territory-hero-content p {
    font-size: 1.25rem;
    color: var(--jj-white);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    opacity: 0.9;
}

.territory-hero-actions {
    margin-top: 2rem;
    gap: 1rem;
    display: flex;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .territory-hero {
        padding: 3rem 1rem 4rem;
    }

    .territory-hero-layout {
        grid-template-columns: 1fr;
    }

    .territory-welcome-panel,
    .territory-contact-copy,
    .territory-hero-content {
        text-align: center;
    }

    .territory-contact-header {
        flex-direction: column;
    }
    
    .territory-hero-content h1 {
        font-size: 2.25rem;
    }
    
    .territory-hero-content p {
        font-size: 1.1rem;
    }
    
    .territory-hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .territory-hero-actions .btn-jj-primary,
    .territory-hero-actions .btn-jj-secondary,
    .territory-hero-actions .territory-hero-outline-button,
    .territory-contact-cta {
        width: 100%;
        max-width: 280px;
    }
}

/* Search Section */
.search-section {
    background: var(--jj-white);
    padding: 3rem 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.search-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--jj-white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

/* Search Form Styles */
.search-form {
    display: flex;
    gap: 1.5rem;
    align-items: end;
    background: #F9FAFB;
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid #E5E7EB;
}

.search-form .form-group {
    flex: 1;
}

.search-form label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.search-form input,
.search-form select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--jj-white);
    color: #374151;
    font-family: inherit;
}

.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--jj-red);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
    transform: translateY(-1px);
}

.search-form input:hover,
.search-form select:hover {
    border-color: #D1D5DB;
}

.search-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 3rem;
}

.search-form .search-button {
    flex: 0 0 auto;
    padding: 1rem 2rem;
    background: var(--jj-red);
    color: var(--jj-white);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.search-form .search-button:hover {
    background: var(--jj-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
}

@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .search-form .search-button {
        width: 100%;
    }
}

/* Results Section */
.results-section {
    padding: 3rem 1rem;
    background: #FAFAFA;
    min-height: 400px;
}

.results-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Territory Cards */
.territory-card {
    background: var(--jj-white);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 6px 25px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 5px solid var(--jj-red);
}

.territory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.territory-header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.territory-image {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--jj-red);
    flex-shrink: 0;
}

.territory-image.placeholder {
    background: linear-gradient(135deg, var(--jj-red), var(--jj-yellow));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--jj-white);
}

.territory-info {
    flex: 1;
}

.territory-info h3 {
    color: var(--jj-red);
    margin: 0 0 0.75rem 0;
    font-size: 1.6rem;
    font-weight: bold;
    line-height: 1.3;
}

.territory-meta {
    color: var(--jj-gray);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.territory-description {
    color: #555;
    line-height: 1.6;
    margin: 1rem 0 1.5rem 0;
    font-size: 1rem;
}

.territory-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--jj-gray);
    flex-wrap: wrap;
}

.territory-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--jj-gray-light);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-weight: 500;
}

.territory-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Class Cards */
.class-type-header {
    border-left: 4px solid var(--class-type-accent-colour, var(--jj-blue));
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.class-type-header h3 {
    color: var(--class-type-accent-colour, var(--jj-blue));
    font-weight: bold;
    margin: 0;
}

.class-card {
    background: var(--jj-white);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 4px solid var(--class-accent-colour, var(--jj-blue));
}

.class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
}

/* Buttons */
.btn-jj-primary {
    background: var(--jj-red);
    border: none;
    color: var(--jj-white);
    border-radius: 30px;
    padding: 1rem 2.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 10px rgba(229, 57, 53, 0.2);
    min-width: 160px;
    text-align: center;
}

.btn-jj-primary:hover {
    background: var(--jj-red-dark);
    color: var(--jj-white);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.4);
    text-decoration: none;
}

.btn-jj-waitlist {
    background: var(--jj-orange);
    border: none;
    color: var(--jj-white);
    border-radius: 30px;
    padding: 1rem 2.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 10px rgba(255, 152, 0, 0.25);
    min-width: 160px;
    text-align: center;
}

.btn-jj-waitlist:hover {
    background: #e68900;
    color: var(--jj-white);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
    text-decoration: none;
}

.btn-jj-secondary {
    background: var(--jj-yellow);
    border: none;
    color: #333;
    border-radius: 30px;
    padding: 1rem 2.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.2);
    min-width: 160px;
    text-align: center;
}

.btn-jj-secondary:hover {
    background: var(--jj-yellow-dark);
    color: #333;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
    text-decoration: none;
}

/* Availability Badges */
.availability-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    display: inline-block;
    cursor: default;
    pointer-events: none;
}

.availability-open {
    background: var(--jj-green);
    color: var(--jj-white);
}

.availability-open:hover {
    background: #3d8b40;
    color: var(--jj-white);
}

.availability-limited {
    background: var(--jj-orange);
    color: var(--jj-white);
}

.availability-limited:hover {
    background: #e68900;
    color: var(--jj-white);
}

.availability-waitlist {
    background: var(--jj-yellow);
    color: var(--jj-red);
}

.availability-waitlist:hover {
    background: var(--jj-yellow-dark);
    color: var(--jj-red);
}

.availability-full {
    background: var(--jj-red);
    color: var(--jj-white);
}

/* Term display on discover class cards */
.term-name-current {
    display: inline-block;
    margin-top: 0.15rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--jj-red);
}

.term-badge-upcoming {
    display: inline-block;
    margin-bottom: 0.25rem;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    background: var(--jj-yellow);
    color: var(--jj-red);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Form Styles */
.form-section {
    background: var(--jj-white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 2rem auto;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--jj-gray-light);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--jj-red);
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--jj-gray-light);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
    background: var(--jj-white);
}

.form-select:focus {
    outline: none;
    border-color: var(--jj-red);
}

/* Responsive Design */
@media (max-width: 768px) {
    .territory-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .territory-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .territory-image {
        width: 80px;
        height: 80px;
        align-self: center;
    }
    
    .territory-stats {
        justify-content: center;
        gap: 0.75rem;
    }
    
    .territory-stat {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
    
    .territory-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .search-container {
        padding: 2rem 1.5rem;
    }
    
    .results-section {
        padding: 2rem 1rem;
    }
    
    .hero-section {
        padding: 3rem 1rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
}

/* Footer */
.jj-footer {
    background: var(--jj-red);
    background-image: url('/static/images/backgrounds/orange.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--jj-white);
    padding: 2rem 1rem;
    text-align: center;
}

.jj-footer .container {
    max-width: 1200px;
    margin: 0 auto;
}

.jj-footer p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.text-center { text-align: center; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 1rem; }

/* Enquiry Form Styles */
.enquiry-form .form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: block;
}

.enquiry-form .form-control,
.enquiry-form .form-select {
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.enquiry-form .form-control:focus,
.enquiry-form .form-select:focus {
    border-color: var(--jj-red);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
    outline: none;
}

.enquiry-form .form-control:hover,
.enquiry-form .form-select:hover {
    border-color: #D1D5DB;
}

.enquiry-form .text-danger {
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.enquiry-form .form-text {
    margin-top: 0.25rem;
    color: #6B7280;
    font-size: 0.875rem;
}

/* Search Option Cards */
.search-option-card {
    background: var(--jj-white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #E5E7EB;
}

.search-option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.search-option-card h3 {
    font-size: 1.5rem;
    font-weight: bold;
}

.search-option-card .form-control {
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-option-card .form-control:focus {
    border-color: var(--jj-red);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
    outline: none;
}

.discover-location-search-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.discover-location-search-row {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.discover-location-search-row > input {
    flex: 1 1 220px;
}

.discover-location-current-button {
    flex: 0 0 auto;
    border: 2px solid var(--jj-blue);
    background: var(--jj-white);
    color: var(--jj-blue);
    border-radius: 12px;
    padding: 0.95rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    transition: all 0.3s ease;
}

.discover-location-current-button:hover,
.discover-location-current-button:focus {
    border-color: var(--jj-blue-dark);
    color: var(--jj-blue-dark);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.12);
    outline: none;
}

.discover-location-current-button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.discover-location-status {
    min-height: 1.25rem;
    font-size: 0.9rem;
    color: #6B7280;
}

.discover-location-status.discover-location-status-error {
    color: var(--jj-red);
}

/* Class Search Form Styles */
.class-search-form .form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    display: block;
}

.class-search-form .form-control-wrapper {
    position: relative;
}

.class-search-form select,
.class-search-form input {
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    background: var(--jj-white);
    color: #374151;
}

.class-search-form select:focus,
.class-search-form input:focus {
    border-color: var(--jj-red);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.class-search-form select:hover,
.class-search-form input:hover {
    border-color: #D1D5DB;
}

.class-search-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 3rem;
}

/* Age Filter Cards */
.age-filter-card {
    display: block;
    text-decoration: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    height: 100%;
    min-height: 140px;
}

.age-filter-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    text-decoration: none;
}

.age-filter-content {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.age-filter-content h5 {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.age-filter-content p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.age-filter-icon {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.age-filter-card:hover .age-filter-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Comprehensive Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Hero Section */
    .hero-section {
        padding: 2rem 1rem;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-section p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Search Sections */
    .search-section {
        padding: 2rem 1rem;
    }
    
    .search-container {
        padding: 1.5rem;
    }
    
    .search-form {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .search-form .form-group {
        width: 100%;
    }
    
    .search-form .search-button {
        width: 100%;
        margin-top: 1rem;
    }
    
    /* Search Option Cards */
    .search-option-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .search-option-card .row {
        flex-direction: column;
        text-align: center;
    }
    
    .search-option-card .col-md-8,
    .search-option-card .col-md-4 {
        width: 100%;
        max-width: 100%;
    }
    
    .search-option-card .col-md-4 {
        margin-top: 1rem;
    }
    
    .search-option-card h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .search-option-card .d-flex {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-option-card input {
        margin-bottom: 0.75rem;
    }
    
    /* Class Search Form */
    .class-search-form .row {
        flex-direction: column;
    }
    
    .class-search-form .col-md-4,
    .class-search-form .col-md-3,
    .class-search-form .col-md-2 {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    .class-search-form .d-flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    .class-search-form .btn-jj-primary,
    .class-search-form .btn-jj-secondary {
        width: 100%;
        min-width: auto;
    }
    
    /* Territory Cards */
    .territory-card {
        margin-bottom: 1rem;
    }
    
    .territory-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .territory-image {
        align-self: center;
        margin-bottom: 1rem;
    }
    
    .territory-actions {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .territory-actions .btn-jj-primary,
    .territory-actions .btn-jj-secondary {
        width: 100%;
        text-align: center;
    }
    
    .territory-stats {
        justify-content: center;
        gap: 1rem;
    }
    
    /* Class Cards */
    .class-card {
        margin-bottom: 1rem;
    }
    
    .class-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .class-header .d-flex {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }
    
    .class-header .d-flex .d-flex {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }
    
    /* Age Filter Cards */
    .age-filter-card {
        min-height: 120px;
        margin-bottom: 1rem;
    }
    
    .age-filter-content {
        padding: 1rem;
    }
    
    .age-filter-content h5 {
        font-size: 1rem;
    }
    
    .age-filter-content p {
        font-size: 0.85rem;
    }
    
    .age-filter-icon {
        top: 0.25rem;
        right: 0.25rem;
    }
    
    .age-filter-icon img {
        width: 30px !important;
        height: 30px !important;
    }
    
    /* Buttons */
    .btn-jj-primary,
    .btn-jj-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-width: auto;
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.75rem !important;
    }
    
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    /* Form Sections */
    .form-section {
        padding: 1.5rem;
    }
    
    .enquiry-form .row {
        flex-direction: column;
    }
    
    .enquiry-form .col-md-6,
    .enquiry-form .col-md-8,
    .enquiry-form .col-12 {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Results Section */
    .results-section {
        padding: 2rem 1rem;
    }
    
    .results-container {
        padding: 1rem;
    }
    
    /* Territory Hero */
    .territory-hero {
        padding: 2rem 1rem 3rem;
    }
    
    .territory-hero-content h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .territory-hero-content p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .territory-hero-content img {
        width: 100px;
        height: 100px;
        margin-bottom: 1.5rem;
    }
    
    /* Footer */
    .jj-footer {
        padding: 1.5rem 1rem;
        text-align: center;
    }
    
    .jj-footer p {
        font-size: 0.85rem;
    }
    
    /* Utility Classes for Mobile */
    .flex-wrap {
        flex-wrap: wrap;
    }
    
    .text-center {
        text-align: center !important;
    }
    
    /* Container Padding */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}
