/* Virtual Pet Section */
.virtual-pet {
    margin-top: 20px;
    background-color: #ffe4e1; /* Light pink background */
    padding: 20px;
    border-radius: 20px;
    color: #5a0033;
    text-align: center;
    box-shadow: 0 4px 6px rgba(255, 105, 180, 0.3);
}

.virtual-pet h3 {
    color: #ff69b4;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.virtual-pet .section-icon {
    width: 24px;
    vertical-align: middle;
    margin-right: 8px;
}

.pet-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.pet-display {
    margin-bottom: 15px;
    position: relative; /* Ensure positioning for the wrapper */
}

/* Pet Wrapper with Border */
.pet-wrapper {
    width: 150px;
    height: 150px;
    border: 3px solid #ff69b4; /* Consistent border color */
    border-radius: 50%;
    background-color: #fff0f8;
    overflow: hidden; /* Clip any overflowing parts of the image */
    position: relative;
    transition: border-color 0.3s ease; /* Smooth border color transitions if needed */
}

/* Pet Image */
.pet-wrapper img#petImage {
    width: 100%;
    height: 100%;
    transition: filter 0.3s ease; /* Smooth filter transitions */
    border: none; /* Remove existing border */
    border-radius: 50%; /* Ensure image fits within the wrapper */
    /* Optional: Add transform for better fit */
    object-fit: cover;
}

/* Pet Actions Buttons */
.pet-actions button {
    margin: 5px;
    padding: 10px 20px;
    background-color: #ff69b4;
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.pet-actions button:hover {
    background-color: #ff1493;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(255, 105, 180, 0.4);
}

.pet-actions button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Pet Stats */
.pet-stats {
    margin-top: 15px;
    font-size: 1.2em;
}

.pet-stats p {
    margin: 5px 0;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.pet-display img.interact {
    animation: interact 0.5s;
}

@keyframes interact {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Particle Styles */
.particle {
    position: absolute;
    width: 36px; /* Adjust size as needed */
    height: 36px;
    pointer-events: none;
    opacity: 1;
    animation: floatUp 2s forwards;
    border: none;
    background: none;
}

/* Float Up Animation */
@keyframes floatUp {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x-move, 0px), -150px) scale(0.5) rotate(360deg);
        opacity: 0;
    }
}

/* Pet Name Display */
#petNameDisplay {
    font-size: 1.8em;
    color: #ff69b4;
    margin-bottom: 10px;
}

/* Customize Button */
#customizeButton {
    margin: 10px;
    padding: 8px 16px;
    background-color: #ff69b4;
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

#customizeButton:hover {
    background-color: #ff1493;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(255, 105, 180, 0.4);
}

#customizeButton:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Customize Modal Styles */
.customize-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black with opacity */
}

.customize-modal-content {
    background-color: #ffe4e1;
    margin: 10% auto; /* 10% from the top and centered */
    padding: 20px;
    border: 1px solid #ff69b4;
    width: 80%;
    max-width: 400px;
    border-radius: 20px;
    position: relative;
    color: #5a0033;
}

.customize-close-button {
    color: #ff69b4;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.customize-close-button:hover,
.customize-close-button:focus {
    color: #ff1493;
    text-decoration: none;
    cursor: pointer;
}

.customize-modal h2 {
    display: flex;
    align-items: center;
    justify-content: center;
}

.customize-modal .section-icon {
    width: 24px;
    vertical-align: middle;
    margin-right: 8px;
}

.customize-form-group {
    margin-bottom: 15px;
}

.customize-form-group label {
    display: block;
    font-size: 1em;
    margin-bottom: 5px;
}

.customize-form-group input[type="text"],
.customize-form-group input[type="range"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ff69b4;
    border-radius: 10px;
}

.customize-save-button {
    width: 100%;
    padding: 20px 10px; /* 20px top & bottom, 10px left & right */
    background-color: #ff69b4;
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    margin-bottom: 10px;
}

.customize-save-button:hover {
    background-color: #ff1493;
}

/* Pet Preview in Modal */
.pet-preview {
    text-align: center;
    margin-bottom: 15px;
}

.pet-preview img {
    width: 100px;
    height: 100px;
    border: 2px solid #ff69b4;
    border-radius: 50%;
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* Word Bubble Container */
.word-bubble-container {
    position: absolute;
    top: -60px; /* Adjust as needed to position above the pet */
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 200px;
    pointer-events: none; /* Allow clicks to pass through */
}

/* Individual Word Bubble */
.word-bubble {
    position: relative;
    background-color: rgba(255, 255, 255, 0.9);
    color: #5a0033;
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
    opacity: 0;
    animation: fadeInOut 4s forwards;
    font-size: 1em;
    text-align: center;
}

/* Triangle Tail of the Bubble */
.word-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px; /* Position the tail */
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0 10px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.9) transparent transparent transparent;
}

/* Fade In and Fade Out Animation */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    10% {
        opacity: 1;
        transform: translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}
