/* CSS Variables */

:root {
    --header-font: 'Inter', sans-serif;
    --body-font: 'PT Sans', sans-serif;
    --primary-color: #2C3E50;
    --secondary-color: #F0F8FF;
    --accent-color: #708090;
    --button-color: #20B2AA;
    --button-hover-color: #008B8B;
}

/* Global Styles */

body {
    font-family: var(--body-font);
    background-image: linear-gradient(var(--secondary-color), rgba(32, 178, 170, 0.5));
    color: var(--primary-color);
    overflow-x: hidden;
}

/* Prevent any potential horizontal overflow */
html {
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

/* Ensure cards with margins don't exceed container width */
.card.m-2 {
    max-width: calc(100% - 1rem);
}

/* Ensure Bootstrap containers don't overflow */
.container,
.container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5 {
    font-family: var(--header-font);
    color: var(--primary-color);
}

h1 { 
    font-size: 3rem;
}

/* Explicit font-size for h1 within sections to address Lighthouse warning */
section h1 {
    font-size: 3rem;
}

h2 { 
    font-size: 2rem;
}

h3 { 
    font-size: 1.5rem;}

section {
    /* Space for fixed navbar */
    scroll-margin-top: 80px; 
}

/* Add padding to all sections except hero */
section:not(#hero) {
    padding: 1.5rem 0;
}

.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Navigation */

nav{
    background-color: var(--primary-color);
}

.custom-text-color {
    /* Override bootstrap classes */
    color: var(--secondary-color);
}

.navbar-brand {
    font-family: var(--header-font);
}

.navbar-brand:hover, .navbar-brand:focus {
    /* override browser styles */
    color: white;
}
.nav-link:hover, .nav-link:focus {
    color: white;
    text-decoration: underline;
}

.navbar-toggler {
  border: 1.5px solid var(--secondary-color);
}

/* Buttons */

.btn-secondary {
    background-color: var(--button-color);
    border-color: var(--button-color);
    color: black;
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: var(--button-hover-color);
    border-color: var(--button-hover-color);
    color: white;
}

/* Main */

main {
    /* Adjusted for fixed navbar height */
    padding-top: 56px; 
    /* Space for footer */
    padding-bottom: 2rem; 
}

/* Hero Section  - embedded in HTML*/


/* About Section */

#about img {
    width: 200px;
    height: 200px;
    border-radius: 0.5rem;
}

/* Recognise the Signs Section */

#recognise-signs .card-title {
    color: var(--primary-color);
}

#recognise-signs .card-body .card-text {
    color: var(--primary-color);
}

#recognise-signs .card-img-top {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
}

#recognise-signs .card {
    background-color: var(--secondary-color);
    border: 1px solid var(--primary-color);
    min-height: 600px;
}

/* Respond to Concerns Section */

#respond-to-concerns .card-title {
    color: var(--secondary-color);
}

#respond-to-concerns .card-body .card-text {
    color: var(--secondary-color);
}

#respond-to-concerns .card-body {
    /* All cards the same size */
    min-height: 250px;
}

#respond-to-concerns i {
    color: var(--button-color);
    margin-left: 0.8rem;
}
#respond-to-concerns a {
    color: var(--secondary-color);
    text-decoration: underline;}

#respond-to-concerns .card {
    background-color: var(--primary-color);
    border: 1px solid var(--secondary-color);
}

/* Further Information Section */

#info-carousel .carousel-inner {
    height: 400px;
}

#info-carousel .carousel-item {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#info-carousel .carousel-item img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
}

#info-carousel .carousel-caption {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px);
    max-width: 600px;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

.carousel-caption h5 {
    /* Override color for carousel captions to keep them visible on images */
    color: white;
}

.carousel-caption p {
    color: white;
}

/* Footer */

#footer {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 1rem;
}

footer a {
    color: var(--secondary-color);
}

#contact i {
    color: var(--button-color);
}

#social-media i {
    font-size: 2rem;
    color: var(--button-color);
    padding: 1rem 0;
}

#contact {
    border: 2px solid var(--button-color);
}

#contact p {
    font-size: 1.2rem;
}

/* Media Queries */

/* Tablets - reduce carousel height */
@media screen and (max-width: 991px) {
    #info-carousel .carousel-inner,
    #info-carousel .carousel-item {
        height: 300px;
    }
}

/* Mobile - reduce carousel height */
@media screen and (max-width: 576px) {
    #info-carousel .carousel-inner,
    #info-carousel .carousel-item {
        height: 250px;
    }
    
    #info-carousel .carousel-caption {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* Mobiles, tablets, small desktops */
@media screen and (max-width: 992px) {
    .navbar .nav-link {
        /* Align items with the "report a concern" button when navbar menu collapsed */
        padding-left: 0.7rem;
    }
}

/* Tablets and larger */
@media screen and (min-width: 768px) {
    /* Hide captions on larger screens since carousel captions are present */
    #info-captions {
        display: none;
    }
}

/* Desktops */

@media screen and (min-width: 993px) {
    /* Text larger on larger screens */
    #about .about-text {
        font-size: 1.2rem;
    }
}
