/*
|--------------------------------------------------------------------------
| File: asset/css/mywork.css
| Deskripsi: Styling untuk section "My Work", termasuk galeri proyek,
|            efek glitch pada judul, dan tombol animasi.
|--------------------------------------------------------------------------
*/

.mywork-section {
    padding: 4rem 2rem;
    background-color: #000000;
    position: relative;
    overflow: hidden; /* Mencegah elemen keluar dari section */
}

.mywork-container {
    max-width: 1400px;
    margin: auto;
}

.mywork-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    gap: 2rem;
}

.mywork-header h1 {
    font-size: 4rem;
    font-weight: bold;
    margin: 0;
    position: relative;
    color: white;
}

.mywork-header h1 span:first-child {
    color: #ff6b6b;
}

/* Glitch Effect for "Work" */
.mywork-header h1 .mywork-glitch {
    position: relative;
    display: inline-block;
    padding: 10px 20px;
    font-size: 4rem;
    border: none;
    border-radius: 5px;
    color: white;
    background-color: transparent;
}

.mywork-header h1 .mywork-glitch::after {
    --move1: inset(50% 50% 50% 50%);
    --move2: inset(31% 0 40% 0);
    --move3: inset(39% 0 15% 0);
    --move4: inset(45% 0 40% 0);
    --move5: inset(45% 0 6% 0);
    --move6: inset(14% 0 61% 0);
    clip-path: var(--move1);
    content: 'Work';
    position: absolute;
    top: 10px;
    left: 20px;
    right: 0;
    bottom: 0;
    display: block;
    animation: mywork-glitch-idle 3s infinite;
}

.mywork-header h1:hover .mywork-glitch::after {
    animation: mywork-glitch-anim 1s steps(2, end) infinite;
    text-shadow: 10 10px 10px black;
    text-shadow: -3px -3px 0px #1df2f0, 3px 3px 0px #E94BE8;
    background-color: transparent;
}


.mywork-header h1:hover .mywork-glitch {
    text-shadow: -1px -1px 0px #1df2f0, 1px 1px 0px #E94BE8;
}

@keyframes mywork-glitch-anim {
    0% { clip-path: var(--move1); transform: translate(0px, -10px); }
    10% { clip-path: var(--move2); transform: translate(-10px, 10px); }
    20% { clip-path: var(--move3); transform: translate(10px, 0px); }
    30% { clip-path: var(--move4); transform: translate(-10px, 10px); }
    40% { clip-path: var(--move5); transform: translate(10px, -10px); }
    50% { clip-path: var(--move6); transform: translate(-10px, 10px); }
    60% { clip-path: var(--move1); transform: translate(10px, -10px); }
    70% { clip-path: var(--move3); transform: translate(-10px, 10px); }
    80% { clip-path: var(--move2); transform: translate(10px, -10px); }
    90% { clip-path: var(--move4); transform: translate(-10px, 10px); }
    100% { clip-path: var(--move1); transform: translate(0); }
}

@keyframes mywork-glitch-idle {
    0% { clip-path: var(--move1); transform: translate(0px, -2px); }
    2% { clip-path: var(--move2); transform: translate(-5px, 2px); }
    6% { clip-path: var(--move3); transform: translate(5px, 0px); }
    8% { clip-path: var(--move4); transform: translate(-5px, 2px); }
    10% { clip-path: var(--move5); transform: translate(5px, -2px); }
    12% { clip-path: var(--move6); transform: translate(-5px, 2px); }
    14% { clip-path: var(--move1); transform: translate(0); }
    100% { clip-path: var(--move1); transform: translate(0); }
}


/* ===== CUSTOM ANIMATED QUOTE ===== */
.mywork-quote {
    color: white;
    font-style: italic;
    max-width: 450px; /* Adjusted max-width slightly for the new design */
    text-align: right;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
    padding: 1rem;
    display: flex; /* Added for alignment */
    justify-content: flex-end; /* Ensures content inside is right-aligned */
    background-color: #000000; /* Background for the container */
    border: none;
}

/* Removing the old corner borders */
.mywork-quote::before,
.mywork-quote::after {
    display: none;
}

.animated-quote {
    position: relative;
    display: inline-block;
    padding: 15px 30px;
    border: 2px solid #fefefe;
    text-transform: uppercase;
    color: #fefefe;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem; /* Matched font-size with the original quote */
    text-align: right; /* Ensure text inside is right-aligned */
    font-style: italic; /* Match original style */
}

.animated-quote::before {
    content: '';
    position: absolute;
    top: 6px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% - 12px);
    background-color: #000000;
    transition: 0.3s ease-in-out;
    transform: scaleY(1);
}

.animated-quote:hover::before {
    transform: scaleY(0);
}

.animated-quote::after {
    content: '';
    position: absolute;
    left: 6px;
    top: -2px;
    height: calc(100% + 4px);
    width: calc(100% - 12px);
    background-color: #000000;
    transition: 0.3s ease-in-out;
    transform: scaleX(1);
    transition-delay: 0.5s; /* You had a typo here, fixed from 0.5s */
}

.animated-quote:hover::after {
    transform: scaleX(0);
}

.animated-quote span {
    position: relative;
    z-index: 3;
    text-transform: none; /* Keep original text casing */
    line-height: 1.5; /* Match original line height */
}

/* ===== GALLERY ===== */
.mywork-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.mywork-gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1a1a1a;
    height: 250px;
}

.mywork-gallery img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
    display: block;
    transition: all 0.3s ease;
}

.mywork-gallery-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    z-index: 1;
    pointer-events: none;
    transition: all 0.3s ease;
}

.mywork-gallery-item:hover::before {
    border-color: #ff5569;
    animation: mywork-borderPulse 1.5s infinite;
}

@keyframes mywork-borderPulse {
    0% { border-width: 2px; opacity: 1; }
    50% { border-width: 4px; opacity: 0.7; }
    100% { border-width: 2px; opacity: 1; }
}

.mywork-button-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 250px; /* Adjust height to match images */
}

/* ===== BUTTON ===== */
.mywork-button {
    --primary: #222222;
    --neutral-1: #f7f8f7;
    --neutral-2: #e7e7e7;
    --radius: 14px;
    cursor: pointer;
    border-radius: var(--radius);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    border: none;
    box-shadow: 0 0.5px 0.5px 1px rgba(255, 255, 255, 0.2), 0 10px 20px rgba(0, 0, 0, 0.2), 0 4px 5px 0px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    min-width: 200px;
    padding: 20px;
    height: 68px;
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-size: 18px;
    font-weight: 600;
    background: transparent;
    width: 100%;
    max-width: 400px; /* Match gallery item width */
}

.mywork-button:hover {
    transform: scale(1.02);
    box-shadow: 0 0 1px 2px rgba(255, 255, 255, 0.3), 0 15px 30px rgba(0, 0, 0, 0.3), 0 10px 3px -3px rgba(0, 0, 0, 0.04);
}

.mywork-button:active {
    transform: scale(1);
    box-shadow: 0 0 1px 2px rgba(255, 255, 255, 0.3), 0 10px 3px -3px rgba(0, 0, 0, 0.2);
}

.mywork-button:after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    border: 2.5px solid transparent;
    background: linear-gradient(var(--neutral-1), var(--neutral-2)) padding-box, linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.45)) border-box;
    z-index: 0;
    transition: all 0.4s ease;
}

.mywork-button:hover::after {
    transform: scale(1.05, 1.1);
    box-shadow: inset 0 -1px 3px 0 rgba(255, 255, 255, 1);
}

.mywork-button::before {
    content: "";
    inset: 7px 6px 6px 6px;
    position: absolute;
    background: linear-gradient(to top, var(--neutral-1), var(--neutral-2));
    border-radius: 30px;
    filter: blur(0.5px);
    z-index: 2;
}

.mywork-state p {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.mywork-state .mywork-icon {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    margin: auto;
    transform: scale(1.25);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mywork-state .mywork-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.mywork-outline {
    position: absolute;
    border-radius: inherit;
    overflow: hidden;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
    inset: -2px -3.5px;
}

.mywork-outline::before {
    content: "";
    position: absolute;
    inset: -100%;
    background: conic-gradient(from 180deg, transparent 60%, rgb(237, 237, 237) 80%, transparent 100%);
    animation: mywork-spin 2s linear infinite;
    animation-play-state: paused;
}

@keyframes mywork-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mywork-button:hover .mywork-outline {
    opacity: 1;
}

.mywork-button:hover .mywork-outline::before {
    animation-play-state: running;
}

.mywork-state p span {
    display: block;
    opacity: 0;
    animation: mywork-slideDown 0.8s ease forwards calc(var(--i) * 0.03s);
}

.mywork-button:hover p span {
    opacity: 1;
    animation: mywork-wave 0.5s ease forwards calc(var(--i) * 0.02s);
}

.mywork-button:focus p span {
    opacity: 1;
    animation: mywork-disapear 0.6s ease forwards calc(var(--i) * 0.03s);
}

@keyframes mywork-wave {
    30% { opacity: 1; transform: translateY(4px) translateX(0) rotate(0); }
    50% { opacity: 1; transform: translateY(-3px) translateX(0) rotate(0); color: var(--primary); }
    100% { opacity: 1; transform: translateY(0) translateX(0) rotate(0); }
}

@keyframes mywork-slideDown {
    0% { opacity: 0; transform: translateY(-20px) translateX(5px) rotate(-90deg); color: var(--primary); filter: blur(5px); }
    30% { opacity: 1; transform: translateY(4px) translateX(0) rotate(0); filter: blur(0); }
    50% { opacity: 1; transform: translateY(-3px) translateX(0) rotate(0); }
    100% { opacity: 1; transform: translateY(0) translateX(0) rotate(0); }
}

@keyframes mywork-disapear {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(5px) translateY(20px); color: var(--primary); filter: blur(5px); }
}

.mywork-state--default .mywork-icon img {
    animation: mywork-land 0.6s ease forwards;
}

.mywork-button:hover .mywork-state--default .mywork-icon {
    transform: rotate(45deg) scale(1.25);
}

.mywork-button:focus .mywork-state--default .mywork-icon img {
    animation: mywork-takeOff 0.8s linear forwards;
}

.mywork-button:focus .mywork-state--default .mywork-icon {
    transform: rotate(0) scale(1.25);
}

@keyframes mywork-takeOff {
    0% { opacity: 1; }
    60% { opacity: 1; transform: translateX(70px) rotate(45deg) scale(2); }
    100% { opacity: 0; transform: translateX(160px) rotate(45deg) scale(0); }
}

@keyframes mywork-land {
    0% { transform: translateX(-60px) translateY(30px) rotate(-50deg) scale(2); opacity: 0; filter: blur(3px); }
    100% { transform: translateX(0) translateY(0) rotate(0); opacity: 1; filter: blur(0); }
}

.mywork-state--default .mywork-icon:before {
    content: "";
    position: absolute;
    top: 50%;
    height: 2px;
    width: 0;
    left: -5px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.5));
}

.mywork-button:focus .mywork-state--default .mywork-icon:before {
    animation: mywork-contrail 0.8s linear forwards;
}

@keyframes mywork-contrail {
    0% { width: 0; opacity: 1; }
    8% { width: 15px; }
    60% { opacity: 0.7; width: 80px; }
    100% { opacity: 0; width: 160px; }
}

.mywork-state {
    padding-left: 29px;
    z-index: 2;
    display: flex;
    position: relative;
}

.mywork-state--default span:nth-child(4) {
    margin-right: 5px;
}

.mywork-state--sent {
    display: none;
}

.mywork-state--sent .mywork-icon img {
    transform: scale(1.25);
    margin-right: 8px;
}

.mywork-button:focus .mywork-state--default {
    position: absolute;
}

.mywork-button:focus .mywork-state--sent {
    display: flex;
}

.mywork-button:focus .mywork-state--sent span {
    opacity: 0;
    animation: mywork-slideDown 0.8s ease forwards calc(var(--i) * 0.2s);
}

.mywork-button:focus .mywork-state--sent .mywork-icon img {
    opacity: 0;
    animation: mywork-appear 1.2s ease forwards 0.8s;
}

@keyframes mywork-appear {
    0% { opacity: 0; transform: scale(4) rotate(-40deg); filter: blur(4px); }
    30% { opacity: 1; transform: scale(0.6); filter: blur(1px); }
    50% { opacity: 1; transform: scale(1.2); filter: blur(0); }
    100% { opacity: 1; transform: scale(1); }
}

/* === PERUBAHAN POPUP DIMULAI === */

/* Popup Styles */
.mywork-popup-overlay {
    /* Menggunakan position: absolute agar relatif terhadap .mywork-section */
    position: absolute; 
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(10, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100; /* Cukup tinggi untuk di dalam section */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mywork-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mywork-popup-content {
    background: radial-gradient(circle, #2a0a0a, #1a0000);
    padding: 2rem;
    border-radius: 8px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    border: 2px solid #ff4d4d;
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.5);
    transform: scale(0.5);
    opacity: 0;
    transition: all 0.3s ease;
    animation: mywork-red-glow 1.5s infinite;
}

.mywork-popup-overlay.active .mywork-popup-content {
    /* Menggunakan animasi masuk yang baru */
    animation: mywork-popup-shock 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both, mywork-red-glow 1.5s infinite;
}

/* Style untuk ikon dan judul baru di popup */
.mywork-popup-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    filter: invert(92%) sepia(44%) saturate(2439%) hue-rotate(0deg) drop-shadow(0 0 10px #ff8c8c);
}

.mywork-popup-title {
    color: #ff8c8c;
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
}

.mywork-popup-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #f0f0f0;
}

.mywork-popup-close {
    background-color: #ff4d4d;
    color: white;
    border: 2px solid #ff8c8c;
    padding: 0.7rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.mywork-popup-close:hover {
    background-color: #ff8c8c;
    border-color: #ff4d4d;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 20px rgba(255, 0, 0, 0.3);
}

/* Keyframe untuk animasi "kaget" */
@keyframes mywork-popup-shock {
    0% { transform: scale(0.3) rotate(10deg); opacity: 0; }
    25% { transform: scale(1.1) rotate(-8deg); opacity: 1; }
    50% { transform: scale(0.95) rotate(6deg); }
    75% { transform: scale(1.02) rotate(-4deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Keyframe untuk border yang berkedip */
@keyframes mywork-red-glow {
    0% { box-shadow: 0 0 40px rgba(255, 0, 0, 0.5); }
    50% { box-shadow: 0 0 60px rgba(255, 80, 80, 0.8); }
    100% { box-shadow: 0 0 40px rgba(255, 0, 0, 0.5); }
}

/* === PERUBAHAN POPUP SELESAI === */


/* Responsive adjustments */
@media (max-width: 768px) {
    .mywork-header h1, .mywork-header h1 .mywork-glitch {
        font-size: 3rem;
    }
    .mywork-gallery {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    .mywork-container {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .mywork-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .mywork-quote {
        text-align: center;
    }
    .mywork-header h1, .mywork-header h1 .mywork-glitch {
        font-size: 2.5rem;
    }
    .mywork-container {
        padding: 1rem;
    }
}

/* Ensure SVG in mywork-gallery has no background */
.mywork-gallery img[src*='.svg'] {
    background: transparent !important;
}