@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animation-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.phone-mockup {
    width: 300px;
    height: 550px;
    background: #f8f9fa;
    border: 14px solid #2c2c2c;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15), 0 20px 50px rgba(0,0,0,0.1);
    position: relative;
    transform: scale(0.9);
}

.phone-mockup::after {
    content: '';
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: #ccc;
    border-radius: 10px;
    z-index: 10;
}

.status-bar {
    position: absolute;
    top: 14px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    padding: 5px 15px;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

.screen {
    width: 100%;
    height: 100%;
    background: white;
    overflow: hidden;
    position: relative;
    border-radius: 16px;
}

.posts-container {
    width: 100%;
    height: 100%;
    position: relative;
    padding-top: 30px; /* Make space for status bar */
}

.post-cycle {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: cycle-posts 28s infinite;
}

#post1 { animation-delay: 0s; }
#post2 { animation-delay: 7s; }
#post3 { animation-delay: 14s; }
#post4 { animation-delay: 21s; }

.post-header {
    display: flex;
    align-items: center;
    padding: 10px;
    color: #333;
}

.profile-pic {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.post-image {
    width: 100%;
}

.comment-thread {
    padding: 15px;
    color: #333;
}

.comment {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    opacity: 0;
}

/* Text and CTA Animations */
.animate-fade-in-up {
    opacity: 0;
    animation: fade-in-up 0.8s ease-out forwards;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.highlight {
    background-color: rgba(77, 182, 172, 0.2); /* Use theme's primary color with alpha */
    padding: 0.1rem 0.4rem;
    border-radius: 5px;
}

.curly-font-header {
    font-family: 'Pacifico', cursive;
    font-weight: bold;
    color: #424242; /* Charcoal */
}

.underlined-highlight {
    position: relative;
    display: inline-block;
}

.underlined-highlight::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Master animation keyframes */
@keyframes cycle-posts {
    0%, 100% { opacity: 0; }
    4%, 21% { opacity: 1; }
    25%, 100% { opacity: 0; }
}

@keyframes add-good-comment {
    0%, 10% { opacity: 0; transform: translateY(20px); }
    15%, 95% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; }
}

@keyframes handle-bad-comment {
    0%, 25% { opacity: 0; transform: translateY(20px); max-height: 50px; background-color: transparent; }
    30%, 65% { opacity: 1; transform: translateY(0); max-height: 50px; background-color: transparent; }
    66% { background-color: rgba(220, 53, 69, 0.3); }
    70% { background-color: rgba(220, 53, 69, 0.3); }
    71%, 95% { opacity: 0; max-height: 0; }
    100% { opacity: 0; max-height: 0; }
}

@keyframes add-second-good-comment {
    0%, 40% { opacity: 0; transform: translateY(20px); }
    45%, 95% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; }
}

/* Applying animations to each post's comments */
.good-comment:first-of-type {
    animation: add-good-comment 7s infinite;
}

.bad-comment {
    animation: handle-bad-comment 7s infinite;
}

.good-comment:last-of-type {
    animation: add-second-good-comment 7s infinite;
}
