:root {
    --main-color: #5d9e7b;
    --secondary-color1: #88C5A4;
    --secondary-color2: #407B5C;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f5f9fa;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 0;
    min-height: 100vh;
}

nav {
    background-color: var(--secondary-color2);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-left {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.nav-center {
    display: flex;
    justify-content: center;
    flex: 0;
}

.nav-center a {
    margin: 0 1rem;
    white-space: nowrap;
}

.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav-right a {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-weight: 600;
    margin-left: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-right a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffffcc;
}

.nav-right a.admin-btn {
    background-color: #ff4d4d;
    border: 1px solid #ff1a1a;
    color: white;
}

.nav-right a.admin-btn:hover {
    background-color: #ff1a1a;
}

.nav-right a i {
    margin-right: 0.4rem;
    line-height: 1;
}

nav a {
    display: flex;
    align-items: center;
    color: white;
    margin: 0 1rem;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

nav a i {
    margin-right: 0.4rem;
    line-height: 1;
}

nav a:hover {
    color: #ffffffcc;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    z-index: 2000;
}

.mobile-nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    text-align: center;
    background-color: var(--secondary-color2);
    position: absolute;
    top: 60px;
    left: 0;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.mobile-nav-links.active {
    display: flex;
    max-height: 500px;
}

.mobile-nav-links a {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

h1,
h2 {
    color: var(--main-color);
    margin-bottom: 1rem;
}

footer {
    background-color: var(--secondary-color2);
    color: white;
    text-align: center;
    padding: 1rem;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.footer-link {
    color: white;
    font-weight: 300;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #d1f0e0;
}

main {
    flex: 1;
    padding-bottom: 4rem;
}

.logo-header {
    width: 100%;
    background-color: var(--secondary-color1);
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.animated-logo {
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.5s ease-in-out;
}

.animated-logo:hover {
    transform: scale(1.05);
}

.hero {
    color: #555;
    padding: 1rem 1rem;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.25rem;
    max-width: 800px;
    margin: auto;
}

.services {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-around;
    margin-bottom: 2rem;
}

.service-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    text-align: center;
    flex: 1 1 250px;
    max-width: 300px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.service-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.service-card h3 {
    color: var(--main-color);
    margin-bottom: 0.5rem;
}

.service-card p {
    font-size: 0.95rem;
    color: #555;
}

.news-item {
    background-color: white;
    border-left: 5px solid var(--secondary-color2);
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.news-item h3 {
    margin-bottom: 0.3rem;
    color: var(--main-color);
}

.news-item small {
    display: block;
    color: #888;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
}

.news-item p {
    color: #555;
    font-size: 0.95rem;
    white-space: pre-line;
}

.news-links {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.news-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.news-links a.edit-btn {
    background-color: #f0f0f0;
    color: var(--secondary-color2);
    border: 1px solid #ccc;
}

.news-links a.edit-btn:hover {
    background-color: var(--secondary-color1);
    color: var(--main-color);
    transform: translateY(-1px);
}

.news-links a.delete-btn {
    background-color: #ff4d4d;
    color: white;
    border: none;
}

.news-links a.delete-btn:hover {
    background-color: #e60000;
    transform: translateY(-1px);
}

.news-links a i {
    font-size: 0.8rem;
}

.admin-add,
.new-emergency,
.admin-add-news {
    display: inline-block;
    background-color: #ff4d4d;
    color: white;
    font-weight: 600;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.admin-add:hover,
.new-emergency:hover,
.admin-add-news:hover {
    background-color: #e60000;
    transform: translateY(-2px);
}

.terms-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.terms-checkbox a {
    color: var(--main-color);
    text-decoration: underline;
}

.terms-checkbox label {
    color: #333;
}

.terms-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

@media (max-width: 1024px) {
    nav {
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem 1rem;
    }

    .nav-left,
    .nav-center,
    .nav-right {
        justify-content: center;
        margin: 0.3rem 0;
    }

    .nav-center a,
    .nav-right a {
        font-size: 0.9rem;
        padding: 0.5rem 0.7rem;
    }

    .logo-header .animated-logo {
        max-height: 150px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .services {
        flex-direction: column;
        gap: 1rem;
    }

    .service-card {
        max-width: 100%;
    }

    .news-item {
        padding: 0.8rem 1rem;
    }

    .news-item p {
        font-size: 0.9rem;
    }

    .footer-link {
        display: block;
        margin: 0.3rem 0;
    }

    section {
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0.5rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }

    .logo-header .animated-logo {
        max-height: 120px;
    }

    .service-card {
        flex: 1 1 100%;
        max-width: 100%;
        padding: 1rem;
    }

    .news-item {
        padding: 0.6rem 0.8rem;
    }

    .news-item p {
        font-size: 0.85rem;
    }

    .news-links a {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }

    .admin-add,
    .new-emergency,
    .admin-add-news {
        width: 100%;
        text-align: center;
        padding: 0.6rem 0;
    }

    .nav-toggle {
        display: block;
        position: absolute;
        top: 0.75rem;
        right: 1rem;
        z-index: 2000;
    }

    .mobile-nav-links {
        display: none;
        flex-direction: column;
        background-color: var(--secondary-color2);
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
        z-index: 1000;
    }

    .mobile-nav-links.active {
        display: flex;
    }

    .mobile-nav-links a {
        margin: 0.5rem 0;
        font-size: 0.95rem;
        padding: 0.5rem 0;
    }
}

@media (hover: none) {

    .service-card,
    .admin-add,
    .new-emergency,
    .admin-add-news,
    .news-links a,
    nav a {
        touch-action: manipulation;
    }
}