:root {
    --primary-color: #113056;
    --secondary-color: #ffffff;
    --active-bg: #2a4b7c; /* Lighter shade of primary color for active nav */
}

body {
    background-color: var(--secondary-color);
    color: #333;
    font-family: 'Arial', sans-serif;
    margin: 0; /* Remove default body margin */
    padding-bottom: 0; /* Prevent white space after footer */
}

.container {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 1200px; /* Centralized layout */
    margin-left: auto;
    margin-right: auto;
}

.logo {
    width: 200px;
    height: auto;
}

header {
    z-index: 1000;
}

.navbar {
    padding: 1rem;
}

.navbar-brand, .navbar-toggler {
    margin: 0 auto; /* Center logo and toggle button on mobile */
}

.navbar-nav {
    text-align: center; /* Center menu items when open on mobile */
}

.navbar-nav .nav-link {
    color: var(--primary-color);
    font-weight: 500;
    margin: 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--secondary-color);
    background-color: var(--primary-color);
    border-radius: 5px;
}

.navbar-nav .nav-link.active {
    color: var(--secondary-color);
    background-color: var(--active-bg);
    border-radius: 5px;
    font-weight: 700;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0d2545; /* Darker shade for hover */
    border-color: #0d2545;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.image-header {
    position: relative;
    max-height: 500px;
    overflow: hidden;
    margin: 0; /* Ensure no margin on image-header */
    padding: 0; /* Ensure no padding on image-header */
}

.carousel-item img {
    object-fit: cover;
    height: 500px;
    width: 100%;
}

.carousel-caption {
    position: absolute;
    top: 40%; /* Move content up on mobile */
    transform: translateY(-50%);
    text-align: center;
    color: var(--secondary-color);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
    opacity: 0;
    animation: checkerboard 1s ease-out forwards; /* Custom animation */
}

.carousel-caption h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.carousel-caption p {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.carousel-caption .btn {
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
}

@keyframes checkerboard {
    0% { opacity: 0; background: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.2) 75%), linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.2) 75%); background-size: 20px 20px; background-position: 0 0; }
    50% { opacity: 0.5; background-position: -10px -10px; }
    100% { opacity: 1; background: none; }
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

section {
    padding: 3rem 0; /* Reduced padding for mobile */
}

.service-item, .team-item {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    transition: all 0.3s ease;
}

.service-item:hover, .team-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.team-image-wrapper {
    position: relative;
    display: inline-block;
}

.team-image-wrapper img.rounded-circle {
    width: 200px;
    height: 200px;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--primary-color);
    transition: transform 0.3s ease;
}

.team-image-wrapper:hover img {
    transform: scale(1.05);
}

.team-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
}

.team-image-wrapper:hover .team-overlay {
    opacity: 1;
}

.team-see-more {
    color: var(--secondary-color);
    background-color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
}

.team-see-more i {
    margin-left: 0.5rem;
}

.award-thumbnail {
    max-width: 100px;
    height: auto;
}

.rating {
    color: #f1c40f; /* Gold for stars */
    margin-bottom: 0.5rem;
}

.lawyer-list .list-group-item {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.lawyer-list .list-group-item:hover {
    background-color: #f0f0f0;
}

.lawyer-list .list-group-item.active {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border-color: var(--primary-color);
}

.lawyer-details .lawyer-profile {
    display: none; /* Hide all profiles by default */
}

.lawyer-details .lawyer-profile.active {
    display: block; /* Show only the active profile */
}

.lawyer-profile img {
    max-width: 200px;
    height: auto;
}

.image-header-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--secondary-color);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
    background-color: rgba(17, 48, 86, 0.7);
    padding: 1rem 2rem;
    border-radius: 5px;
}

.image-header-overlay h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.services-list {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.service-item {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 1rem;
    cursor: pointer;
    background-color: #fff;
    transition: all 0.3s ease;
}

.service-item:hover {
    background-color: #f9f9f9;
}

.service-title {
    padding: 1rem;
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
}

.service-content {
    padding: 0 1rem 1rem;
    margin: 0;
    display: none;
    color: #555;
}

.service-item.active .service-content {
    display: block;
}

footer.bg-primary {
    background-color: var(--primary-color) !important;
    margin-bottom: 0 !important;
}

footer.bg-primary,
footer.bg-primary * {
    background-color: var(--primary-color) !important;
}

footer a:hover {
    text-decoration: underline;
}

.search-form {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--secondary-color);
    border: 1px solid #ddd;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results li {
    padding: 0.5rem;
    cursor: pointer;
}

.search-results li:hover {
    background: #f0f0f0;
}

.home-main {
    margin-top: 0; /* Remove top margin for index.html main */
    padding-top: 0; /* Remove top padding for index.html main */
}

.btn-read-more {
    background-color: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.btn-read-more:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .container {
        padding-left: 20px;
        padding-right: 20px; /* Increased padding for mobile */
    }

    section {
        padding: 2rem 0; /* Further reduce section padding for mobile */
    }

    .navbar {
        padding: 0.5rem 1rem; /* Adjust navbar padding */
    }

    .logo {
        width: 100px;
    }

    .carousel-item img {
        height: 300px;
    }

    .carousel-caption {
        top: 30%; /* Move content further up on mobile */
    }

    .carousel-caption h1 {
        font-size: 1.8rem;
    }

    .carousel-caption p {
        font-size: 1rem;
    }

    .carousel-caption .btn {
        font-size: 0.9rem;
        padding: 0.4rem 1.2rem;
    }

    .team-image-wrapper img.rounded-circle {
        width: 150px;
        height: 150px;
    }

    .team-overlay {
        display: none; /* Hide overlay on mobile for simplicity */
    }

    .lawyer-list {
        margin-bottom: 1rem;
    }

    .lawyer-profile img {
        max-width: 150px;
    }

    .services-list {
        max-width: 100%;
    }

    .service-title {
        font-size: 1rem;
    }
}

@media (min-width: 992px) {
    .image-header:not(.home-main .image-header) {
        padding-top: 70px; /* Add padding to account for sticky nav on non-home pages */
    }
}