@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

/* ===========================
   ROOT VARIABLES & RESET
   =========================== */
:root {
    --mg-accent: #007B7F;
    --mg-highlight: #FF6F3C;
    --mg-dark: #1D3C34;
    --mg-steel: #B0B9B4;
    --mg-light: #E8CBA0;
    --mg-warm: #8A704D;
    --mg-secondary: #4B9DB4;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--mg-dark);
    background-color: white;
    overflow-x: hidden;
}

/* ===========================
   ANIMATIONS & KEYFRAMES
   =========================== */

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Float Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Typing Animation */
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Particle Float */
@keyframes particleFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.3;
    }

    25% {
        transform: translate(10px, -10px) rotate(90deg);
        opacity: 0.6;
    }

    50% {
        transform: translate(-5px, -20px) rotate(180deg);
        opacity: 0.9;
    }

    75% {
        transform: translate(-15px, -10px) rotate(270deg);
        opacity: 0.6;
    }
}

/* ===========================
   UTILITY CLASSES
   =========================== */

/* Reveal Animation Classes */
.reveal-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    transition-delay: var(--delay, 0s);
}

.reveal-item.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Fade In */
.fade-in {
    animation: fadeIn 1s ease-out;
}

/* Float Effect */
.float {
    animation: float 3s ease-in-out infinite;
}

/* Pulse Effect */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ===========================
   HEADER & NAVIGATION
   =========================== */

.header-sticky {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
}

.nav-link {
    position: relative;
    transition: var(--transition-smooth);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--mg-accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile Menu Animation */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.mobile-menu.open {
    max-height: 500px;
}

/* ===========================
   BUTTONS & INTERACTIVE ELEMENTS
   =========================== */

.btn-primary {
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(128, 91, 41, 0.3);
}

/* Interactive Card Hover Effect */
.interactive-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.interactive-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Card Flip Effect */
.flip-card {
    perspective: 1000px;
    height: 100%;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 1rem;
}

.flip-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, var(--mg-accent), var(--mg-highlight));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* ===========================
   HERO SECTION
   =========================== */

.hero-gradient {
    background: linear-gradient(-45deg, #f3f4f6, #e5e7eb, #d1d5db, #f9fafb);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--mg-accent);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 10s infinite;
}

.particle:nth-child(1) {
    left: 10%;
    top: 20%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    left: 20%;
    top: 80%;
    animation-delay: 2s;
}

.particle:nth-child(3) {
    left: 30%;
    top: 40%;
    animation-delay: 4s;
}

.particle:nth-child(4) {
    left: 50%;
    top: 60%;
    animation-delay: 1s;
}

.particle:nth-child(5) {
    left: 70%;
    top: 30%;
    animation-delay: 3s;
}

.particle:nth-child(6) {
    left: 80%;
    top: 70%;
    animation-delay: 5s;
}

.particle:nth-child(7) {
    left: 90%;
    top: 50%;
    animation-delay: 2.5s;
}

/* Typing Effect */
.typing-text {
    overflow: hidden;
    border-right: 3px solid var(--mg-accent);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
    display: inline-block;
}

/* ===========================
   ACCORDION
   =========================== */

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.accordion-content.open {
    max-height: 500px;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-icon.rotate {
    transform: rotate(180deg);
}

/* ===========================
   FORMS
   =========================== */

.form-input {
    transition: var(--transition-smooth);
    border: 2px solid #e5e7eb;
}

.form-input:focus {
    outline: none;
    border-color: var(--mg-accent);
    box-shadow: 0 0 0 3px rgba(128, 91, 41, 0.1);
    transform: translateY(-2px);
}

.form-input.error {
    border-color: #ef4444;
}

.form-input.success {
    border-color: #10b981;
}

/* Form Label Animation */
.floating-label {
    position: relative;
}

.floating-label input:focus+label,
.floating-label input:not(:placeholder-shown)+label {
    transform: translateY(-1.5rem) scale(0.85);
    color: var(--mg-accent);
}

.floating-label label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    transition: var(--transition-smooth);
    pointer-events: none;
}

/* ===========================
   LOADING & PROGRESS
   =========================== */

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--mg-light);
    border-top: 5px solid var(--mg-accent);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.progress-bar {
    height: 4px;
    background-color: var(--mg-light);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mg-accent), var(--mg-highlight));
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: shimmer 2s infinite;
}

/* ===========================
   TOOLTIPS & MODALS
   =========================== */

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background-color: var(--mg-dark);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.modal.open {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background-color: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.open .modal-content {
    transform: scale(1);
}

/* ===========================
   SCROLL TO TOP BUTTON
   =========================== */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--mg-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.scroll-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

/* ===========================
   RESPONSIVE UTILITIES
   =========================== */

@media (max-width: 768px) {

    .reveal-item,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        transform: none;
    }

    .interactive-card:hover {
        transform: none;
    }

    .particle {
        display: none;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================
   CUSTOM SCROLLBAR
   =========================== */

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--mg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--mg-accent);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--mg-highlight);
}