/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    margin-bottom: 1rem;
}

.loading-logo img {
    width: 80px;
    height: 80px;
    filter: brightness(0) invert(1);
}

.loading-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.loading-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    animation-delay: 0.5s;
    animation-duration: 1.2s;
}

.spinner-ring:nth-child(3) {
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    animation-delay: 1s;
    animation-duration: 0.9s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-progress {
    width: 300px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Floating Elements Animation */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.leaf,
.butterfly {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.6;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.leaf {
    color: var(--secondary-green);
    animation-name: leafFall;
}

.butterfly {
    color: var(--accent-green);
    animation-name: butterflyFloat;
}

.leaf-1 {
    top: -50px;
    left: 10%;
    animation-duration: 15s;
    animation-delay: 0s;
}

.leaf-2 {
    top: -50px;
    left: 60%;
    animation-duration: 20s;
    animation-delay: 5s;
}

.leaf-3 {
    top: -50px;
    left: 85%;
    animation-duration: 18s;
    animation-delay: 10s;
}

.butterfly-1 {
    top: 20%;
    left: -50px;
    animation-duration: 25s;
    animation-delay: 2s;
}

.butterfly-2 {
    top: 60%;
    left: -50px;
    animation-duration: 30s;
    animation-delay: 15s;
}

@keyframes leafFall {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(calc(100vh + 50px)) rotate(360deg);
        opacity: 0;
    }
}

@keyframes butterflyFloat {
    0% {
        transform: translateX(-50px) translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    25% {
        transform: translateX(25vw) translateY(-20px) rotate(5deg);
    }

    50% {
        transform: translateX(50vw) translateY(20px) rotate(-3deg);
    }

    75% {
        transform: translateX(75vw) translateY(-10px) rotate(2deg);
    }

    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateX(calc(100vw + 50px)) translateY(10px) rotate(-5deg);
        opacity: 0;
    }
}

/* Page Load Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Hover Animations */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-smooth);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: var(--transition-smooth);
}

.btn-primary:hover::after {
    opacity: 1;
}

/* Card Hover Effects */
.preview-card,
.gallery-card,
.quick-contact-item {
    position: relative;
    overflow: hidden;
}

.preview-card::before,
.gallery-card::before,
.quick-contact-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: var(--transition-smooth);
    pointer-events: none;
}

.preview-card:hover::before,
.gallery-card:hover::before,
.quick-contact-item:hover::before {
    opacity: 1;
}

/* 3D Card Tilt Effect */
.gallery-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.gallery-card:hover {
    transform: translateY(-5px) rotateX(5deg) rotateY(2deg);
}

/* Parallax Effect for Hero */
.hero-background {
    transform: translateZ(0);
    will-change: transform;
}

/* Smooth Scrolling Enhancements */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
.loading {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger Animation Delays */
.preview-card:nth-child(1) {
    animation-delay: 0.1s;
}

.preview-card:nth-child(2) {
    animation-delay: 0.2s;
}

.preview-card:nth-child(3) {
    animation-delay: 0.3s;
}

.preview-card:nth-child(4) {
    animation-delay: 0.4s;
}

.gallery-item:nth-child(1) {
    animation-delay: 0.1s;
}

.gallery-item:nth-child(2) {
    animation-delay: 0.2s;
}

.gallery-item:nth-child(3) {
    animation-delay: 0.3s;
}

.gallery-item:nth-child(4) {
    animation-delay: 0.4s;
}

.gallery-item:nth-child(5) {
    animation-delay: 0.5s;
}

.gallery-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* Form Field Focus Animation */
.form-input:focus {
    animation: inputFocus 0.3s ease-out;
}

@keyframes inputFocus {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

/* Icon Spin Animation */
.download-btn:hover i {
    animation: spin 0.5s ease-in-out;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Social Links Hover */
.social-link {
    position: relative;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-green);
    transform: scale(0);
    transition: var(--transition-smooth);
    z-index: -1;
}

.social-link:hover::before {
    transform: scale(1);
}

/* Navbar Scroll Effect */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Pulse Animation for Call-to-Action */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(45, 90, 61, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(45, 90, 61, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(45, 90, 61, 0);
    }
}

/* Text Typing Effect */
.typing-effect {
    overflow: hidden;
    border-right: 3px solid var(--primary-green);
    white-space: nowrap;
    animation: typing 3s steps(30, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--primary-green);
    }
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Mobile Animation Adjustments */
@media (max-width: 768px) {
    .floating-elements {
        display: none;
        /* Hide floating elements on mobile for performance */
    }

    .gallery-card:hover {
        transform: translateY(-3px);
        /* Reduce 3D effects on mobile */
    }

    .preview-card:hover {
        transform: translateY(-3px);
    }

    /* Disable 3D tilt transforms on mobile to prevent overflow issues */
    .gallery-card, .preview-card { transform: none !important; }
    .gallery-card:hover, .preview-card:hover { transform: none !important; }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .floating-elements {
        display: none;
    }
}