
/* Variables for consistent theming */
:root {
    --primary-color: #1a4b84;
    --secondary-color: #3273dc;
    --accent-color: #ffdd57;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --medium-gray: #dbdbdb;
    --dark-gray: #4a4a4a;
    --white: #ffffff;
    --nav-hover: #0e3261;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s ease;
    --preloader-bg: #ffffff;
    --preloader-text: #1a4b84;
    --spinner-border: #f3f3f3;
    --spinner-top: #1a4b84;
}

/* Dark mode variables */
:root[data-theme="dark"] {
    --primary-color: #2c5282;
    --secondary-color: #4299e1;
    --text-color: #e2e8f0;
    --light-gray: #2d3748;
    --medium-gray: #4a5568;
    --dark-gray: #cbd5e0;
    --white: #1a202c;
    --nav-hover: #63b3ed;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    --preloader-bg: #1a202c;
    --preloader-text: #e2e8f0;
    --spinner-border: #2d3748;
    --spinner-top: #4299e1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration:none;
}

body {
    font-family: 'Open Sans', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    font-family: 'Open Sans', 'Helvetica', 'Arial', sans-serif;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow);
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

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

.logo-link {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 1rem;
    color: var(--white);
}

.logo {
    height: 50px;
    margin-right: 1rem;
}

.site_title {
    font-family: 'Montserrat', 'Helvetica', 'Arial', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
}

#menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

#menu-toggle:hover {
    background-color: var(--nav-hover);
    border-radius: 4px;
}

/* Navigation */
nav {
    border-radius: 25px 0 25px 0;
    box-shadow: 3px 10px 16px #0f2e68ff;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

#primary-nav {   
    display: flex;
    list-style: none;
    justify-content: center;
    transition: var(--transition);
}

#primary-nav li {
    padding: 0;
}

#primary-nav a {
    display: block;
    color: var(--white);
    text-decoration: none;
    padding: 1rem;
    transition: var(--transition);
    position: relative;
}

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

#primary-nav a.active {
    /* background-color: var(--nav-hover); */
    font-weight: bold;
}

#primary-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent-color);
}

/* Hero Section */
.hero {
    position: relative;
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero picture,
.hero img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--white);
    background-color: rgba(0, 0, 0, 0.64);
    padding: 1.5rem;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
}

.hero h1 {
    font-family: 'Montserrat', 'Helvetica', 'Arial', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.hero p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--text-color);
    padding: 0.8rem 1.5rem;
    border-radius: 10px 0 10px 0;
    font-weight: bold;
    text-decoration: none;
    transition: var(--transition);
}

.cta-button:hover {
    background-color: #ffc107;
    transform: translateY(-2px);
}

/* Current Events Section */
.current-events {
    margin-bottom: 2rem;
}

.current-events h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.events-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.event-card {
    background-color: var(--white);
    border-radius: 15px 0 15px 0;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.event-card h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.event-date {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.event-location {
    font-style: italic;
    margin-bottom: 0.8rem;
    color: var(--dark-gray);
}

/* Weather Section */
.weather {
    margin-bottom: 2rem;
}

.weather h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.weather-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.current-weather,
.forecast {
    background-color: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.weather-container h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

#current-temp {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.5rem;
}

#weather-desc {
    text-align: center;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

#weather-humidity {
    text-align: center;
    color: var(--dark-gray);
}

.forecast-days {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.forecast-day {
    text-align: center;
    padding: 1rem;
    background-color: var(--light-gray);
    border-radius: 6px;
}

.forecast-date {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.forecast-temp {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Company Spotlights Section */
.spotlights {
    margin-bottom: 2rem;
}

.spotlights h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.spotlight-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.spotlight-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.spotlight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.spotlight-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.spotlight-info {
    padding: 1.5rem;
}

.spotlight-info h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.spotlight-address,
.spotlight-phone {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.spotlight-website {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
}

.spotlight-website:hover {
    text-decoration: underline;
}

.spotlight-membership {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.membership-gold {
    background-color: #ffd700;
    color: var(--light-gray);
}

.membership-silver {
    background-color: #c0c0c0;
    color: var(--white);
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.directory-main h1 {
    text-align: center;
    margin-bottom: 1.3rem;
    font-weight: 700;
    color: var(--secondary-color);
}

/* View Toggle */
.view-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.view-toggle button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    background-color: var(--white);
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.view-toggle button:first-child {
    border-radius: 10px 0 0 0;
}

.view-toggle button:last-child {
    border-radius: 0 0 10px 0;
}

.view-toggle button.active,
.view-toggle button:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* Directory Container */
#directory-container {
    display: grid;
    gap: 1.5rem;
    min-height: 400px;
}

/* Grid View */
.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.member-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.member-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.member-info {
    padding: 1rem;
}

.member-info h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.member-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.member-description {
    font-style: italic;
    color: var(--dark-gray);
}

.member-website {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
}

.member-website:hover {
    text-decoration: underline;
}

.membership-level {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.membership-1 {
    background-color: var(--medium-gray);
    color: var(--dark-gray);
}

.membership-2 {
    background-color: #c0c0c0;
    color: var(--white);
}

.membership-3 {
    background-color: #aea305ff;
    color: var(--light-gray);
}

/* List View */
.list-view {
    grid-template-columns: 1fr;
}

.list-view .member-card {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 1rem;
    align-items: center;
}

.list-view .member-image {
    height: 80px;
    width: 80px;
    border-radius: 50%;
}

.list-view .member-info {
    padding: 0.5rem;
}

.list-view .membership-level {
    margin-right: 1rem;
}

/* Error message */
.error-message {
    text-align: center;
    color: #d32f2f;
    font-size: 1.2rem;
    grid-column: 1 / -1;
    padding: 2rem;
    background-color: #ffebee;
    border-radius: 8px;
    border-left: 4px solid #d32f2f;
}

.info-message {
    text-align: center;
    color: #1976d2;
    font-size: 1.2rem;
    grid-column: 1 / -1;
    padding: 2rem;
    background-color: #e3f2fd;
    border-radius: 8px;
    border-left: 4px solid #1976d2;
}

.member-image.placeholder {
    height: 150px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #757575;
    font-style: italic;
}

/* Footer */
footer {
    font-family: 'Montserrat', 'Helvetica', 'Arial', sans-serif;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 2rem 1rem;
    margin-top: auto;
    font-weight: 600;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.social-links {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}


.social-links img {
    width: 40px;
    height: 40px;
    transition: transform 0.3s;
    /* filter: brightness(0) invert(1);  */
    opacity: 0.9;
}

.social-links img:hover {
    transform: scale(1.2);
}

footer h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.development-info p {
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--preloader-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--spinner-border);
    border-top: 5px solid var(--spinner-top);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#preloader p {
    color: var(--preloader-text);
    font-weight: 600;
}

/* Dark Mode Toggle Button */
.header-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#dark-mode-toggle {
    /* background: none; */
    position: fixed;
    bottom: 0;
    right: 1%;
    border: 2px solid var(--secondary-color);
    color: var(--white);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: var(--transition);
}

#dark-mode-toggle:hover {
    background-color: #ffffff1a;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    
    .header-content {
        justify-content: space-between;
        flex-direction: column;
        padding: 2rem;
        text-align: center;
    }
    
    .header-left {
        flex: 1;
    }
    

    .weather-container {
        grid-template-columns: 1fr 2fr;
    }

    .logo {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    #menu-toggle {
        display: block;
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    #primary-nav {
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-out;
    }
    
    #primary-nav.show {
        max-height: 300px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .list-view .member-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .list-view .member-image {
        justify-self: center;
    }
}

@media screen and (max-width: 480px) {
    /* Styles within the Hero section */
    .hero-content {
        position: relative;
        transform: none;
        top: auto;
        left: auto;
        width: 100%;
        margin-top: -4rem;
        background-color: rgba(0, 0, 0, 0.7);
    }
    
    .events-container,
    .spotlight-container {
        grid-template-columns: 1fr;
    }
    
    .forecast-days {
        grid-template-columns: 1fr;
    }

    /* Styles within the Main section */
    main {
        padding: 1rem;
    }
    
    .grid-view {
        grid-template-columns: 1fr;
    }
    
    .site_title, .hero h1 {
        font-size: 1rem;
    }
    .directory-main h1{
        font-size: .9rem;
    }

    .view-toggle{
        font-size: .75rem;
    }

}
