/* ============================
   Root Variables
============================ */
:root {
    /* Typography */
    --font-main: 'Poppins', sans-serif;

    /* Colors */
    --color-bg: #ffffff;
    --color-text: #111;
    --color-muted: #666;
    --color-primary: #2D9596;
    --color-hover: #265073;
    --color-nav-link: #444;
    --color-shadow: rgba(0, 0, 0, 0.06);
}

/* ============================
     Reset & Base
  ============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================
     Header
  ============================ */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    position: relative;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    cursor: pointer;
    z-index: 100;
}

.bar1, .bar2, .bar3 {
    width: 25px;
    height: 3px;
    background-color: var(--color-text);
    margin: 5px 0;
    transition: 0.4s;
}

/* Rotate first bar */
.hamburger-menu.opened .bar1 {
    transform: translateY(8px) rotate(-45deg);
}

/* Fade out the second bar */
.hamburger-menu.opened .bar2 {
    opacity: 0;
}

/* Rotate last bar */
.hamburger-menu.opened .bar3 {
    transform: translateY(-8px) rotate(45deg);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    color: var(--color-nav-link);
    position: relative;
    padding: 0.25rem 0;
    transition: color 0.3s ease;
}

nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

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

nav a:hover::after {
    width: 100%;
}

nav a.active {
    color: var(--color-primary);
    font-weight: 600;
}

nav a.active::after {
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    body {
        padding: 0 1rem;
    }
    
    .hamburger-menu {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--color-bg);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 6rem 2rem 2rem;
        transition: right 0.3s ease;
        z-index: 90;
    }

    .nav-menu.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 1.5rem;
    }

    nav a {
        font-size: 1.1rem;
        display: block;
        padding: 0.5rem 0;
    }
}

/* ============================
     Hero Section
  ============================ */
.hero {
    text-align: center;
    margin: 4rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.hero p {
    font-size: 1.2rem;
    color: var(--color-muted);
}

/* ============================
     Gallery
  ============================ */
.gallery .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.gallery img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--color-shadow);
    transition: transform 0.3s ease;
}

.gallery img:hover {
    transform: scale(1.02);
}

/* Gallery loading animation */
@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

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

.gallery .grid .spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
  position: relative;
  top: -2px;
}

.gallery .grid p.loading {
  text-align: center;
  padding: 20px;
  color: #777;
  animation: pulse 1.5s infinite;
  font-style: italic;
  width: 100%;
  grid-column: 1 / -1;
  margin: 0;
}

/* Error message styling */
.gallery .grid .error-message {
  color: #d32f2f;
  text-align: center;
  padding: 20px;
  background-color: #ffebee;
  border-radius: 4px;
  margin: 20px auto;
  max-width: 80%;
  animation: none;
  font-style: normal;
  grid-column: 1 / -1;
}

/* ============================
     Footer
  ============================ */
footer {
    text-align: center;
    padding-top: 1rem;
    padding-bottom: 1.3rem;
    color: var(--color-muted);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: auto;
}

footer p {
    margin-top: 0.7rem;
    font-size: 0.95rem;
    margin-bottom: 0;
}

footer .socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0;
    margin-bottom: 0;
}

footer .socials a {
    position: relative;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

footer .socials a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-hover);
    transition: width 0.3s ease;
}

footer .socials a:hover {
    color: var(--color-hover);
    transform: translateY(-2px);
}

footer .socials a:hover::before {
    width: 100%;
}

/* Media query for better mobile spacing */
@media (max-width: 768px) {
    footer .socials {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    footer .socials a {
        padding: 0.5rem;
    }
}

/* ============================
   Contact Page
============================ */
.contact {
    max-width: 600px;
    margin: 4rem auto;
    padding: 0 1rem;
    text-align: center;
}

/* Adding responsive styles for contact page on mobile screens */
@media (max-width: 768px) {
    .contact {
        margin: 3rem auto;
        padding: 0;
        width: 100%;
    }
    
    .contact-form {
        padding: 0 0.5rem;
    }
}

.contact h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact p {
    color: var(--color-muted);
    margin-bottom: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.contact-form label {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.contact-form input,
.contact-form textarea {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-main);
}

.contact-form button {
    background-color: var(--color-primary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.contact-form button:hover {
    background-color: var(--color-hover);
}

/* ============================
   About Page
============================ */
.about {
    max-width: 900px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.about h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.about-content {
    display: flex;
    flex-direction: column-reverse;
    gap: 2rem;
}

.about-text {
    font-size: 1.1rem;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: justify;
}

.about-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--color-shadow);
}

/* Responsive layout */
@media (min-width: 768px) {
    .about-content {
        flex-direction: row;
        align-items: center;
    }

    .about-text {
        flex: 2;
    }

    .about-image {
        flex: 1;
        text-align: center;
    }
}

/* ============================
   Custom Scrollbar
============================ */
/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) #f1f1f1;
}
