@import url('https://fonts.googleapis.com/css2?family=Marcellus&family=Outfit:wght@300;400;600&display=swap');

.ciasteczko-wrapper {
    font-family: 'Outfit', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    background: #fdfbf7;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.ciasteczko-container {
    width: 100%;
    max-width: 700px;
    position: relative;
    z-index: 1;
    text-align: center;
}

.ciasteczko-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/bamboo-bg.webp');
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
    z-index: -1;
}

.cookie-machine {
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    margin-bottom: 30px;
}

.cookie-closed {
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-closed img {
    width: 200px !important;
    height: auto !important;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.2));
}

.cookie-closed:hover {
    transform: scale(1.05) rotate(2deg);
}

.cookie-closed:active {
    transform: scale(0.95);
}

.cookie-opened {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cookie-half {
    width: 100px !important;
    height: 150px !important;
    z-index: 2;
    transition: transform 1s ease-out;
    overflow: hidden;
    position: relative;
}

.cookie-half img {
    width: 200px !important;
    max-width: none !important;
    height: auto !important;
    position: absolute;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.15));
}

/* We use the same image for both halves but position it */
.cookie-half.left {
    transform: translateX(10px) rotate(-10deg);
}

.cookie-half.left img {
    left: 0;
}

.cookie-half.right {
    transform: translateX(-10px) rotate(10deg);
}

.cookie-half.right img {
    right: 0;
}

.cookie-opened.active .cookie-half.left {
    transform: translateX(-110px) rotate(-30deg);
}

.cookie-opened.active .cookie-half.right {
    transform: translateX(110px) rotate(30deg);
}

.cookie-paper {
    position: absolute;
    background: white;
    padding: 15px 40px;
    width: 280px;
    min-height: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transform: scaleX(0);
    transform-origin: center;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.cookie-opened.active .cookie-paper {
    transform: scaleX(1);
}

.fortune-text {
    font-family: 'Marcellus', serif;
    color: #2c3e50;
    font-size: 1.1rem;
    line-height: 1.5;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease 1.2s;
}

.cookie-opened.active .fortune-text {
    opacity: 1;
}

.ciasteczko-instructions {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-top: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; transform: translateY(-2px); }
    100% { opacity: 0.8; }
}

.ciasteczko-footer {
    margin-top: 30px;
    color: #555;
    font-size: 0.95rem;
}

.ciasteczko-footer a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.ciasteczko-footer a:hover {
    border-bottom-color: #0073aa;
}

.ciasteczko-description {
    margin-top: 40px;
    color: #777;
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.shaking {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}
