/* ================ VARIABLES & BASE STYLES ================ */
:root {
    /* Colors */
    --first-color: hsl(93, 54%, 54%);
    --first-color-alt: hsl(93, 50%, 48%);
    --first-color-light: hsl(93, 58%, 66%);
    --title-color: hsl(228, 8%, 98%);
    --text-color: hsl(228, 8%, 70%);
    --white-color: hsl(228, 8%, 98%);
    --black-color: hsl(228, 6%, 4%);
    --body-color: hsl(228, 6%, 8%);
    --container-color: hsl(228, 6%, 12%);
    
    /* Enhanced Liquid Glass Effects */
    --liquid-glass-bg: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.02) 100%);
    --liquid-glass-border: rgba(255, 255, 255, 0.25);
    --liquid-glass-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 2px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    --liquid-glass-blur: blur(12px);
    
    /* Gradient overlays */
    --green-glass-overlay: linear-gradient(135deg, 
        rgba(131, 201, 74, 0.08) 0%,
        rgba(131, 201, 74, 0.03) 50%,
        rgba(131, 201, 74, 0.01) 100%);

    /* Typography */
    --body-font: "Montserrat", -apple-system, sans-serif;
    --h1-font-size: 1.5rem;
    --normal-font-size: .938rem;

    /* Enhanced Transitions */
    --transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-slow: 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    --bounce-transition: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

body.modal-open {
    overflow: hidden;
}

/* ================ ENHANCED LIQUID GLASS MODAL ================ */
.project-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: var(--liquid-glass-blur);
    -webkit-backdrop-filter: var(--liquid-glass-blur);
    z-index: 1000;
    padding: 2.5vw 1.5vw;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 30%, 
        rgba(131, 201, 74, 0.05) 0%, 
        rgba(0, 0, 0, 0.1) 70%);
    pointer-events: none;
}

.project-overlay--open {
    opacity: 1;
    visibility: visible;
}

.project-modal {
    width: 100%;
    max-width: 520px;
    background: var(--liquid-glass-bg);
    border: 1.5px solid var(--liquid-glass-border);
    border-radius: 20px;
    box-shadow: var(--liquid-glass-shadow);
    backdrop-filter: var(--liquid-glass-blur);
    -webkit-backdrop-filter: var(--liquid-glass-blur);
    overflow: visible;
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 2.5vh 0;
    max-height: 95vh;
    height: auto;
    transform: translateY(50px) scale(0.9) rotateX(10deg);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--green-glass-overlay);
    border-radius: 20px;
    pointer-events: none;
    z-index: -1;
}

.project-modal::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, 
        rgba(131, 201, 74, 0.3) 0%,
        rgba(255, 255, 255, 0.1) 25%,
        rgba(131, 201, 74, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 75%,
        rgba(131, 201, 74, 0.3) 100%);
    border-radius: 21px;
    z-index: -2;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.project-overlay--open .project-modal {
    transform: translateY(0) scale(1) rotateX(0deg);
    opacity: 1;
}

/* Enhanced header with liquid glass effect */
.project-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.3rem 1.7rem 1rem 1.7rem;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.02) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-modal__header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(131, 201, 74, 0.6) 50%,
        transparent 100%);
    border-radius: 0 0 10px 10px;
}

.project-overlay--open .project-modal__header {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.project-modal__header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    flex: 1;
}

#project-modal-title {
    font-size: 1.25rem;
    color: var(--title-color);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.project-modal__icons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.project-modal__icons i {
    font-size: 1.1rem;
    color: var(--first-color-light);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(131, 201, 74, 0.2);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    min-width: 1.8rem;
    text-align: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-modal__icons i:hover {
    color: var(--first-color);
    background: rgba(131, 201, 74, 0.15);
    border-color: var(--first-color);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 16px rgba(131, 201, 74, 0.2);
}

/* Enhanced close button with liquid glass */
.project-modal__close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    width: 42px;
    height: 42px;
    background: rgba(20, 20, 20, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    z-index: 10;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--bounce-transition);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.project-modal__close::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, 
        rgba(131, 201, 74, 0.4),
        rgba(255, 255, 255, 0.2),
        rgba(131, 201, 74, 0.4));
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition);
}

.project-modal__close:hover {
    background: rgba(131, 201, 74, 0.2);
    border-color: var(--first-color);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 24px rgba(131, 201, 74, 0.3);
}

.project-modal__close:hover::before {
    opacity: 1;
}

/* Enhanced body with staggered animations */
.project-modal__body {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    padding: 0 1.7rem 1.7rem 1.7rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-overlay--open .project-modal__body {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

/* Enhanced image with liquid glass frame */
#project-modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 16px;
    margin-top: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.25),
        0 2px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
    transition: all var(--transition);
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.9) rotateY(5deg);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-overlay--open #project-modal-image {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
    transition-delay: 0.4s;
}

#project-modal-image:hover {
    transform: scale(1.02);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 4px 20px rgba(131, 201, 74, 0.1);
}

/* Enhanced description with liquid glass background */
#project-modal-description {
    color: var(--text-color);
    line-height: 1.6;
    font-size: var(--normal-font-size);
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.15) 100%);
    padding: 1.3rem 1.4rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--first-color);
    margin: 0 0 0.3rem 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Enhanced detail groups with liquid glass */
.project-details {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.project-detail-group {
    background: linear-gradient(135deg,
        rgba(131, 201, 74, 0.12) 0%,
        rgba(131, 201, 74, 0.06) 100%);
    padding: 1.2rem 1.3rem;
    border-radius: 16px;
    border: 1px solid rgba(131, 201, 74, 0.2);
    border-left: 4px solid var(--first-color);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.2rem;
    opacity: 0;
    transform: translateX(-30px) rotateY(-5deg);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-overlay--open .project-detail-group {
    opacity: 1;
    transform: translateX(0) rotateY(0deg);
}

.project-overlay--open .project-detail-group:nth-child(1) { transition-delay: 0.5s; }
.project-overlay--open .project-detail-group:nth-child(2) { transition-delay: 0.6s; }
.project-overlay--open .project-detail-group:nth-child(3) { transition-delay: 0.7s; }

.project-detail-group:hover {
    transform: translateX(4px) scale(1.02);
    border-color: var(--first-color);
    box-shadow: 0 6px 24px rgba(131, 201, 74, 0.15);
}

.project-detail-group h4 {
    color: var(--first-color-light);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.project-detail-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
}

.project-detail-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: all var(--transition);
}

.project-detail-item:hover {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(131, 201, 74, 0.3);
    transform: translateX(4px) scale(1.02);
    box-shadow: 0 4px 12px rgba(131, 201, 74, 0.1);
}

.project-detail-item i {
    color: var(--first-color);
    font-size: 1.1rem;
    min-width: 18px;
    text-align: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.project-detail-text {
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--text-color);
    flex: 1;
}

/* Enhanced flip button with liquid glass */
.project-modal__flip-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%);
    color: var(--title-color);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    margin: 1.5rem auto 0.7rem auto;
    align-self: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    text-align: center;
    min-width: fit-content;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.project-modal__flip-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%);
    transition: left 0.6s ease;
}

.project-modal__flip-btn:hover::before {
    left: 100%;
}

.project-overlay--open .project-modal__flip-btn {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.8s;
}

.project-modal__flip-btn:hover {
    background: linear-gradient(135deg,
        rgba(131, 201, 74, 0.9) 0%,
        rgba(131, 201, 74, 0.7) 100%);
    color: var(--black-color);
    border-color: var(--first-color);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(131, 201, 74, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.project-modal__flip-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* ================ RESPONSIVE ENHANCEMENTS ================ */
@media (min-width: 768px) {
    .project-modal {
        max-width: 650px;
        border-radius: 24px;
    }
    .project-modal::after {
        border-radius: 25px;
    }
    .project-modal__header {
        border-radius: 24px 24px 0 0;
    }
    #project-modal-image {
        height: 350px;
        border-radius: 20px;
    }
}

@media (max-width: 700px) {
    .project-modal {
        max-width: 95vw;
        border-radius: 16px;
    }
    .project-modal::after {
        border-radius: 17px;
    }
    .project-modal__header {
        padding: 1.1rem 1rem 0.8rem 1rem;
        border-radius: 16px 16px 0 0;
    }
    .project-modal__body {
        padding: 0 1rem 1.2rem 1rem;
        gap: 1rem;
    }
    #project-modal-image {
        height: 200px;
        border-radius: 12px;
    }
    #project-modal-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 380px) {
    .project-modal__header {
        padding: 1rem 0.7rem 0.6rem 0.7rem;
    }
    .project-modal__body {
        padding: 0 0.7rem 1rem 0.7rem;
        gap: 0.8rem;
    }
    #project-modal-image {
        height: 120px;
        border-radius: 8px;
    }
    #project-modal-title {
        font-size: 1rem;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .project-modal {
        max-height: 98vh;
    }
    #project-modal-image {
        height: 80px;
    }
}

/* ================ ENHANCED SCROLLBAR ================ */
.project-modal__body::-webkit-scrollbar {
    width: 7px;
    margin-right: 4px;
}

.project-modal__body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    margin: 4px 0;
    backdrop-filter: blur(4px);
}

.project-modal__body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        var(--first-color) 0%,
        var(--first-color-alt) 100%);
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.project-modal__body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        var(--first-color-light) 0%,
        var(--first-color) 100%);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.project-modal__body::-webkit-scrollbar-corner {
    background: transparent;
}