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

html {
    font-size: 16px;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: #ddd;
    /* This background image is from your initial CSS.
       If you want the body background to be consistent with the Tailwind bg-gray-900,
       you might remove this background-image property.
       For now, keeping it as per your provided CSS. */
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../../static/lamp-6924294_640.jpg');
    background-size: cover;
    background-attachment: fixed;
    overflow-x: hidden;
    /* Adding a fallback background color consistent with Tailwind if image fails */
    background-color: #1a202c;
}

/* Typography (Consistent with Services Page) */
.writingone {
    font-family: "Bebas Neue", serif;
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.5px;
}

h1,
h2,
h3 {
    color: #eee;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.8rem;
    color: #ffab00;
}

/* Header and Navigation (Consistent with Services Page) */
header {
    background-color: rgba(0, 0, 0, 0.9);
    position: sticky;
    top: 0;
    z-index: 100;
}

#menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

#logo img {
    width: 50px;
    height: 50px;
    filter: invert(1) grayscale(100%) contrast(200%);
}

#menu ul {
    list-style: none;
    display: flex; /* Default to flex for desktop */
    margin: 0;
    padding: 0;
}

#menu ul li {
    margin-left: 1.5rem;
}

#menu ul li a {
    text-decoration: none;
    color: #afafaf;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

#menu ul li a:hover {
    color: white;
}

/* Removed !important for better maintainability */
#userid {
    margin-left: 1.5rem; /* Keep consistent spacing */
}

#mobile-menu-toggle {
    background: none;
    color: #afafaf;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: none; /* Hidden by default for desktop */
}

/* Responsive Navigation for Mobile */
@media (max-width: 768px) { /* Adjust breakpoint as needed */
    #menu {
        flex-wrap: wrap; /* Allow items to wrap */
        justify-content: center; /* Center items when wrapped */
        padding: 1rem;
    }

    #menu ul {
        display: none; /* Hide main menu by default on mobile */
        flex-direction: column; /* Stack vertically if shown */
        width: 100%;
        text-align: center;
        margin-top: 1rem;
    }

    #menu ul.active { /* Class to be toggled by JavaScript */
        display: flex;
    }

    #menu ul li {
        margin: 0.5rem 0; /* Adjust spacing for stacked items */
    }

    #mobile-menu-toggle {
        display: block; /* Show hamburger icon on mobile */
        order: 1; /* Place it first or last if needed, adjust as per design */
    }

    #logo {
        order: 2; /* Adjust order if needed */
        margin-right: auto; /* Push logo to left */
    }

    /* Ensure Userid is part of the mobile menu or handled separately */
    #userid {
        margin-left: 0; /* Reset margin for mobile */
    }
}


/* Engineers Page Styles (from engineers.css) */
#engineers-page {
    padding: 4rem 2rem;
}

.engineers-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 100%;
    margin: 0 auto;
}

.engineer-card {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 15px;
    padding: 2rem; /* Keep this padding for the card itself */
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 500px; /* Increased height to give more room for text, adjust as necessary */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.engineer-card:hover {
    transform: translateY(-5px);
}

.engineer-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem; /* Added margin-bottom for spacing */
}

.engineer-card h2.engineer-name { /* Target h2 specifically as it holds the name */
    color: #eee; /* Ensure consistent heading color */
    font-size: 1.5rem; /* Ensure consistent heading size */
    font-weight: bold;
    text-align: center;
    margin-top: 0; /* Adjusted: No top margin as image has bottom margin */
    margin-bottom: 1rem; /* Space after name before text content */
}

/* Style for the text content wrapper within engineer cards */
.engineer-text-content {
    flex-grow: 1; /* Allows this container to take all available space between name and link */
    max-height: 150px; /* Adjust this value: This is the max combined height for brief + qualifications. Increase if content still overflows. */
    overflow-y: auto; /* Add scrollbar if content exceeds max-height */
    padding-right: 10px; /* Add more padding to the right for the scrollbar. Adjust as needed. */
    padding-left: 10px; /* Add padding to the left */
    text-align: center; /* Center all text inside this container */
    margin-bottom: 1rem; /* Space before the "View Visiting Card" link */

    /* Optional: Style scrollbar for better aesthetics (WebKit browsers) */
    scrollbar-width: thin; /* "auto" or "none" */
    scrollbar-color: #ffab00 #333; /* thumb color track color */
}

/* Optional: Style scrollbar thumb and track (Webkit) */
.engineer-text-content::-webkit-scrollbar {
    width: 8px; /* Width of the scrollbar */
}

.engineer-text-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5); /* Color of the scrollbar track */
    border-radius: 10px;
}

.engineer-text-content::-webkit-scrollbar-thumb {
    background-color: #ffab00; /* Color of the scrollbar thumb */
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.7); /* Border around the thumb */
}

.engineer-brief {
    margin-top: 0; /* Reset default paragraph top margin */
    margin-bottom: 0.5rem; /* Space between brief and qualifications */
    line-height: 1.5; /* Slightly tighter line height for smaller text blocks */
}

.qualifications {
    font-size: 0.9rem; /* Slightly smaller font for qualifications */
    opacity: 0.8; /* Slightly faded for secondary info */
    margin-top: 0; /* Reset default paragraph top margin */
    margin-bottom: 0; /* Ensure no extra space at the bottom */
    line-height: 1.4; /* Slightly tighter line height */
}

/* Uniform Link/Button Style */
.details-link {
    margin-top: auto; /* Pushes to the bottom */
    font-size: 1rem;
    color: #ffab00;
    text-decoration: none;
    transition: color 0.3s ease;
    padding-top: 1rem; /* Added padding to give space from text above */
}

.details-link:hover {
    color: #ffffff;
}

/* Image Gallery Styles (from gallery.css) */
/* Note: Tailwind classes are directly in HTML for most gallery elements.
   These custom styles are primarily for scrollbar appearance. */
.scroll-container::-webkit-scrollbar {
    height: 8px; /* Height of the horizontal scrollbar */
}

.scroll-container::-webkit-scrollbar-track {
    background: #2d3748; /* Darker track color */
    border-radius: 10px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background-color: #4a5568; /* Greyish thumb color */
    border-radius: 10px;
    border: 2px solid #1a202c; /* Border around the thumb */
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background-color: #64748b; /* Lighter thumb on hover */
}

/* Firefox scrollbar styling */
.scroll-container {
    scrollbar-width: thin; /* "auto" or "none" */
    scrollbar-color: #4a5568 #2d3748; /* thumb color track color */
}

/* Visiting Card Page Specific Styles */
.visitingcardpage {
    padding: 4rem 2rem; /* Consistent padding with other sections */
    display: flex; /* Use flexbox to center the card */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    min-height: calc(100vh - 100px); /* Adjust based on header/footer height, ensures it takes up most of the viewport */
}

.visitingcardpage .card {
    /* Tailwind classes already define most of this, but adding for clarity/override */
    background-color: #1f2937; /* bg-gray-800 */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-xl */
    padding: 2.5rem; /* p-6 sm:p-8 */
    max-width: 28rem; /* max-w-md */
    margin: 0 auto; /* mx-auto */
    text-align: center; /* text-center */
    color: #e2e8f0; /* text-gray-100 */
    display: flex; /* Enable flexbox for internal content arrangement */
    flex-direction: column; /* Stack content vertically */
    align-items: center; /* Center items horizontally within the card */
}

.visitingcardpage .card img {
    /* Tailwind classes already define most of this */
    width: 12rem; /* w-48 */
    height: 12rem; /* h-48 */
    object-fit: cover;
    border-radius: 9999px; /* rounded-full */
    margin-bottom: 1rem; /* mb-4 */
    border: 4px solid #f59e0b; /* border-4 border-yellow-500 */
}

.visitingcardpage .card .name {
    /* Tailwind classes already define most of this */
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700; /* font-bold */
    color: #ffffff; /* text-white */
    margin-bottom: 0.5rem; /* mb-2 */
}

.visitingcardpage .card .qualifications {
    /* Tailwind classes already define most of this */
    font-size: 1.125rem; /* text-lg */
    color: #d1d5db; /* text-gray-300 */
    margin-bottom: 1rem; /* mb-4 */
}

.visitingcardpage .card .description {
    /* Tailwind classes already define most of this */
    color: #9ca3af; /* text-gray-400 */
    line-height: 1.625; /* leading-relaxed */
    font-size: 0.875rem; /* text-sm */
    overflow-y: auto; /* Enables scrolling for long descriptions */
    max-height: 16rem; /* max-h-64 (256px) - Limits height, adjust as needed */
    padding-right: 10px; /* Space for scrollbar */
    padding-left: 10px; /* Space for scrollbar */
    margin-bottom: 0; /* Ensure no extra margin pushes content */

    /* Custom scrollbar for this description (similar to engineer-text-content) */
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #2d3748;
}

.visitingcardpage .card .description::-webkit-scrollbar {
    width: 8px;
}

.visitingcardpage .card .description::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

.visitingcardpage .card .description::-webkit-scrollbar-thumb {
    background-color: #4a5568;
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.7);
}

.visitingcardpage .card .description::-webkit-scrollbar-thumb:hover {
    background-color: #64748b;
}
