/* Animated Typography Design specific styles */
.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}
/* SVG styles */
svg {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.typing-code {
    font-family: 'Courier New', monospace;
}

/* Replay button common styles */
.replay-button {
    display: inline-block;
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}

.replay-button:hover {
    background-color: #2980b9;
}

/* Design 1: Fade-In Text */
.design-1 {
    width: 100%;
}

.fade-container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.fade-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.fade-content {
    padding: 20px;
    text-align: center;
}

.fade-in-title {
    opacity: 0;
    animation: fadeIn 1.5s ease-in-out forwards;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
}

.fade-in-text {
    opacity: 0;
    animation: fadeIn 1.5s ease-in-out 0.5s forwards;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Design 2: Typing Effect */
.design-2 {
    width: 100%;
}

.typing-container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.typing-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background-color: #2c3e50;
}

.typing-content {
    padding: 20px;
}

.typing-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
}

.typing-text {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.cursor {
    animation: blink 1s infinite;
    color: #333;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Design 3: Moving Text */
.design-3 {
    width: 100%;
}

.movement-container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.movement-demo {
    padding: 20px;
    position: relative;
}

.slide-in-left, .slide-in-right, .slide-in-top, .slide-in-bottom, .bounce-in {
    opacity: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    padding: 5px 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.slide-in-left {
    animation: slideInLeft 1s forwards;
}

.slide-in-right {
    animation: slideInRight 1s forwards 0.2s;
}

.slide-in-top {
    animation: slideInTop 1s forwards 0.4s;
}

.slide-in-bottom {
    animation: slideInBottom 1s forwards 0.6s;
}

.bounce-in {
    animation: bounceIn 1s forwards 0.8s;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    70% {
        transform: scale(0.9);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Design 4: Emphasis Animation */
.design-4 {
    width: 100%;
}

.emphasis-container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 100%;
    padding: 20px;
    text-align: center;
}

.emphasis-heading {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 20px;
}

.emphasis-content {
    display: flex;
    flex-direction: column;
}

.emphasis-item {
    margin: 8px 0;
    padding: 8px;
    border-radius: 4px;
    background-color: #f8f9fa;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.emphasis-item.shake {
    animation: shake 1s;
}

.emphasis-item.pulse {
    animation: pulse 1s;
}

.emphasis-item.flip {
    animation: flip 1s;
}

.emphasis-item.wobble {
    animation: wobble 1s;
}

.emphasis-item.scale {
    animation: scale 1s;
}

span.pulse {
    display: inline-block;
    animation: pulse 2s infinite;
    color: #e74c3c;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    40% {
        transform: perspective(400px) rotateY(170deg);
    }
    50% {
        transform: perspective(400px) rotateY(190deg);
    }
    80% {
        transform: perspective(400px) rotateY(360deg);
    }
    100% {
        transform: perspective(400px) rotateY(360deg);
    }
}

@keyframes wobble {
    0% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-15%) rotate(-5deg);
    }
    30% {
        transform: translateX(10%) rotate(3deg);
    }
    45% {
        transform: translateX(-10%) rotate(-3deg);
    }
    60% {
        transform: translateX(5%) rotate(2deg);
    }
    75% {
        transform: translateX(-5%) rotate(-1deg);
    }
    100% {
        transform: translateX(0%);
    }
}

@keyframes scale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.5);
    }
    100% {
        transform: scale(1);
    }
}

/* Design 5: Parallax Scrolling Text */
.design-5 {
    width: 100%;
}

.parallax-container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.parallax-demo {
    height: 200px;
    position: relative;
    overflow: hidden;
    background-color: #0d1b2a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.parallax-element {
    position: absolute;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    transition: transform 0.2s ease-out;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.background {
    background-color: rgba(41, 50, 65, 0.5);
    font-size: 12px;
    transform: translate(0, 0);
    z-index: 1;
}

.middle {
    background-color: rgba(69, 123, 157, 0.7);
    font-size: 14px;
    transform: translate(0, 0);
    z-index: 2;
}

.foreground {
    background-color: rgba(168, 218, 220, 0.9);
    color: #1d3557;
    font-size: 16px;
    transform: translate(0, 0);
    z-index: 3;
}

.parallax-instruction {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-family: 'Open Sans', sans-serif;
}

/* Design 6: Creative Text Morphing */
.design-6 {
    width: 100%;
}

.morphing-container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 100%;
    padding: 20px;
    text-align: center;
}

.morphing-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
}

.morphing-demo {
    margin-top: 15px;
}

.morphing-item {
    display: inline-block;
    margin: 0 5px;
    padding: 5px 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

#morph-1 {
    animation: morphToShape 3s ease-in-out 1s forwards;
}

#morph-2 {
    animation: twist 3s ease-in-out 2s forwards;
}

#morph-3 {
    animation: liquidEffect 3s ease-in-out 3s forwards;
}

@keyframes morphToShape {
    0% {
        border-radius: 5px;
        background-color: #f8f9fa;
    }
    50% {
        border-radius: 25px;
        background-color: #3498db;
        color: white;
    }
    100% {
        border-radius: 5px;
        background-color: #f8f9fa;
    }
}

@keyframes twist {
    0% {
        transform: rotate(0deg) scale(1);
        background-color: #f8f9fa;
    }
    50% {
        transform: rotate(180deg) scale(0.8);
        background-color: #e74c3c;
        color: white;
    }
    100% {
        transform: rotate(360deg) scale(1);
        background-color: #f8f9fa;
    }
}

@keyframes liquidEffect {
    0% {
        border-radius: 5px;
        background-color: #f8f9fa;
    }
    50% {
        border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%;
        background-color: #9b59b6;
        color: white;
    }
    100% {
        border-radius: 5px;
        background-color: #f8f9fa;
    }
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .parallax-demo {
        height: 150px;
    }
    .page-title {
        font-size: 1.8rem;
    }
    .background {
        font-size: 10px;
    }

    .middle {
        font-size: 12px;
    }

    .foreground {
        font-size: 14px;
    }
}
