:root {
    --primary-green: #2ecc71;
    --secondary-green: #27ae60;
    --text-color: #333;
    --background-color: #f4f4f4;
    --accent-color: #3498db;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
}

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

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 5px;
}

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

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

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

.hero {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.8), rgba(39, 174, 96, 0.8)), url('hero-background.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 250px 20px;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.2) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 1.5s ease-out;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-button, 
.contact-form button {
    display: inline-block;
    background-color: var(--primary-green);
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.cta-button::before,
.contact-form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: all 0.6s ease;
}

.cta-button:hover::before,
.contact-form button:hover::before {
    left: 100%;
}

.cta-button:hover, 
.contact-form button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.3);
    background-color: var(--secondary-green);
}

.cta-button:active,
.contact-form button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.services, .portfolio, .about, .contact {
    background-color: white;
    border-radius: 10px;
    margin: 40px 5%;
    padding: 60px 5%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background-color: var(--background-color);
    padding: 35px 25px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.4s ease;
    border: 1px solid #f0f0f0;
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    background-color: white;
}

.portfolio-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-top: 40px;
    perspective: 1000px;
}

.portfolio-item {
    background-color: #e9e9e9;
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: all 0.4s ease;
    transition: transform 0.6s ease-out;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-item::before {
    content: attr(data-project);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    background-color: rgba(46, 204, 113, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    z-index: 10;
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.portfolio-item:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--background-color);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.contact-form input, 
.contact-form textarea {
    width: 100%;
    margin-bottom: 20px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.contact-form input:focus, 
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.contact-options {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.email-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.email-button i {
    font-size: 1.2rem;
}

footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 50px 20px;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    margin: 0 10px;
    transition: all 0.3s ease;
    display: inline-block;
}

.social-links a:hover {
    transform: scale(1.2) rotate(360deg);
    color: var(--primary-green);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scroll-animate {
    animation: slideInFromBottom 1s ease-out forwards;
}

.scroll-animate.portfolio {
    animation: fadeInScale 1s ease-out forwards;
}

.scroll-animate .portfolio-item {
    transform: rotateX(10deg) scale(1.05);
    transition-delay: calc(var(--delay) * 0.1s);
}

.reveal {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.show {
    display: flex;
    opacity: 1;
}

.portfolio-popup {
    background-color: white;
    border-radius: 15px;
    max-width: 700px;
    width: 90%;
    max-height: 80%;
    overflow: auto;
    position: relative;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    animation: popupAppear 0.4s ease-out;
}

.popup-content {
    padding: 30px;
    text-align: center;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 35px;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.popup-close:hover {
    color: var(--primary-green);
}

.portfolio-popup img {
    max-width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

.portfolio-popup h3 {
    margin-bottom: 15px;
    color: var(--primary-green);
}

@keyframes popupAppear {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media screen and (max-width: 768px) {
    nav {
        flex-direction: column;
        padding: 1rem 2%;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        text-align: center;
        margin-top: 15px;
    }

    nav ul li {
        margin: 10px 0;
        width: 100%;
    }

    .hero {
        padding: 150px 20px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .service-grid {
        grid-template-columns: 1fr 1fr; 
    }

    .portfolio-gallery {
        grid-template-columns: 1fr 1fr; 
    }

    .contact-form {
        padding: 20px;
        width: 95%;
        margin: 0 auto;
    }

    .social-links a {
        margin: 0 5px;
        font-size: 1.2rem;
    }

    .portfolio-popup {
        width: 95%;
        max-height: 90%;
        margin: 0 5%;
    }

    .popup-content {
        padding: 15px;
    }

    .services,
    .portfolio,
    .about,
    .contact {
        transform: translateY(30px);
    }
}

@media screen and (max-width: 480px) {
    .service-grid,
    .portfolio-gallery {
        grid-template-columns: 1fr; 
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    nav {
        padding: 1rem 3%;
    }
}

@media (max-width: 768px) {
    .cta-button, 
    nav ul li a, 
    .service-card,
    .portfolio-item,
    .social-links a {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-green);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    opacity: 0;
    transform: scale(0.5);
    animation: logoIntro 1.5s ease-out forwards;
}

.loading-subtitle {
    font-size: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: subtitleIntro 1.5s ease-out 0.5s forwards;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background-color: rgba(255,255,255,0.3);
    margin: 20px auto;
    overflow: hidden;
    border-radius: 2px;
}

.loading-progress {
    width: 0;
    height: 100%;
    background-color: white;
    animation: loadingProgress 3s ease-in-out forwards;
}

@keyframes logoIntro {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes subtitleIntro {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loadingProgress {
    0% { width: 0; }
    100% { width: 100%; }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}