/* Color Palette */
:root {
    --deep-blue: #2A3D66;
    --light-blue: #4A90E2;
    --vibrant-teal: #50E3C2;
    --soft-gray: #E3E3E3;
    --electric-magenta: #D00265;
    --neutral-white: #FAFAFA;
    --dark-gray: #2C2C2C;
    --accent-orange: #ff9800;
    --nav-bg: rgba(44, 44, 44, 0.97);
    --nav-text: #FAFAFA;
    --nav-hover: darkgray;
    --nav-active: #ff9800;
    --nav-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--neutral-white);
    padding-top: 110px; /* Reduced from 120px */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 60px; /* Height of footer */
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--nav-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.7rem 0 0.3rem; /* Reduced padding */
    text-align: center;
}

header h1 {
    color: var(--nav-text);
    font-size: 1.2rem; /* Reduced from 1.4rem */
    margin: 0 0 0.2rem 0;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

header img {
    height: 65px; /* Reduced from 80px */
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    margin-bottom: 0.3rem;
}

/* Remove or comment out this hover effect */
/* header img:hover {
    transform: scale(1.05);
} */

nav {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 0;
    padding: 0.6rem 0; /* Reduced from 0.8rem */
    list-style: none;
}

nav ul li a {
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

nav ul li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-orange);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

nav ul li a:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

nav ul li a:hover {
    color: var(--accent-orange);
    background: rgba(255, 255, 255, 0.05);
}

nav ul li a.active {
    background: var(--accent-orange);
    color: var(--nav-bg);
    font-weight: 600;
}

nav ul li a.active:hover::before {
    transform: scaleX(0);
}

main {
    flex: 1 0 auto;
    padding: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow-x: hidden;
    padding-bottom: 60px; /* Add padding to prevent content from being hidden by footer */
    margin-bottom: 2rem;
}

section {
    margin: 0;
    padding: 2rem;
    width: 100%;
    background-color: var(--neutral-white);
    box-sizing: border-box;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

footer {
    background-color: var(--nav-bg);
    color: var(--nav-text);
    text-align: center;
    padding: 1rem 0;
    position: absolute;
    bottom: 0;
    width: 100%;
    border-top: 1px solid var(--nav-border);
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

footer p {
    margin: 0;
    padding: 0;
}

@media (max-width: 768px) {
    body {
        padding-top: 140px; /* Adjust for mobile */
        padding-bottom: 80px; /* Larger footer padding for mobile */
    }
    
    header {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
    }
    
    .header-left {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    header h1 {
        font-size: 1.2rem;
        min-width: 0;
    }
    
    header img {
        height: 60px;
        margin-bottom: 0.3rem;
    }
    
    nav {
        width: 100%;
    }
    
    nav ul {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 0.6rem 0;
        justify-content: center;
    }
    
    nav::-webkit-scrollbar {
        height: 3px;
    }
    
    nav::-webkit-scrollbar-thumb {
        background: var(--nav-border);
        border-radius: 3px;
    }
    
    .hero-content h2 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.2rem;
    }
    
    main {
        padding: 10px;
    }
    
    .content-section {
        padding: 2rem;
    }
    
    .card-container, .features-grid {
        grid-template-columns: 1fr;
    }
    
    footer {
        padding: 1.2rem 0;
    }
}

/* Phase-specific sections */
#solids {
    background-color: var(--light-blue);
    color: var(--neutral-white);
}

#liquids {
    background-color: var(--vibrant-teal);
    color: var(--dark-gray);
}

#gases {
    background-color: var(--soft-gray);
    color: var (--dark-gray);
}

#plasma {
    background-color: var(--electric-magenta);
    color: var(--neutral-white);
}

/* Additional color styling for interactive elements */
.property-card {
    background: var(--neutral-white);
    border-left: 4px solid var(--deep-blue);
}

.quiz-box, .simulation-box {
    background: var(--soft-gray);
}

button {
    background-color: var(--deep-blue);
    color: var(--neutral-white);
}

.content-section {
    padding: 3rem 2rem;
    margin: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 1rem 0;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

.info-card {
    background: var(--neutral-white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    height: 100%;
    margin: 0;
}

.info-card:hover {
    transform: translateY(-5px);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 1rem 0;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.feature {
    padding: 2rem;
    background: var (--deep-blue);
    color: var(--neutral-white);
    border-radius: 10px;
    transition: all 0.3s ease;
    height: 100%;
    margin: 0;
}

.feature:hover {
    transform: scale(1.05);
    background: var(--light-blue);
}

.feature i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--nav-bg);
    position: relative;
    width: 100%;
    height: calc(100vh - 110px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5); /* Darkened overlay */
    pointer-events: none;
}

.hero-content {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1;
}

@media (max-width: 1200px) {
    .card-container, .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* New styles for phases overview and features container */
.phases-overview {
    background: var(--neutral-white);
    padding: 4rem 2rem;
}

.phases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
}

.phase-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.phase-card:hover {
    transform: translateY(-5px);
}

.phase-card img {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.phase-card[data-phase="solids"] { border-left: 4px solid var(--deep-blue); }
.phase-card[data-phase="liquids"] { border-left: 4px solid var(--vibrant-teal); }
.phase-card[data-phase="gases"] { border-left: 4px solid var(--light-blue); }
.phase-card[data-phase="plasma"] { border-left: 4px solid var(--electric-magenta); }

.learn-more {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    background: var(--accent-orange);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.learn-more:hover {
    background: var(--deep-blue);
    transform: translateY(-2px);
}

.features-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-section {
    background: var(--neutral-white);
    padding: 4rem 2rem;
}

.contact-container {
    display: flex;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.contact-info {
    flex: 1;
    padding: 2rem;
    background: var(--deep-blue);
    color: var(--neutral-white);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--accent-orange);
}

.contact-details {
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-icon {
    font-size: 1.5rem;
}

.contact-form {
    flex: 2;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-orange);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.1);
}

.submit-btn {
    background: var(--accent-orange);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: var(--deep-blue);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .contact-container {
        flex-direction: column;
        padding: 1rem;
    }

    .contact-info,
    .contact-form {
        padding: 1.5rem;
    }
}

.gallery-section {
    background: var(--neutral-white);
    padding: 4rem 2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.gallery-caption h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.gallery-caption p {
    font-size: 0.9rem;
    margin: 0;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-caption {
        position: relative;
        transform: none;
        background: var(--nav-bg);
    }
}
