/* Body Styling */
body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #6a11cb, #2575fc); /* Purple gradient background */
    font-family: 'Poppins', sans-serif;
    color: #fff;
}

/* Character Counter Container */
.character-counter {
    background: rgba(255, 255, 255, 0.1); /* Transparent background for glass effect */
    backdrop-filter: blur(12px);
    padding: 30px;
    border-radius: 15px;
    width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #fff;
    text-align: center;
    position: relative;
    animation: fadeIn 0.8s ease forwards, pulse 3s ease-in-out infinite;
    overflow: hidden;
}

/* Decorative Elements for Glowing Borders */
.character-counter::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 60%);
    animation: rotateGlow 6s linear infinite;
    z-index: -1;
}

/* Heading Styling */
.character-counter h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #ffe4c4; /* Light carton color for a classy look */
    font-weight: 700;
    position: relative;
    animation: glowText 2s ease-in-out infinite alternate; /* Glow animation for elegance */
}

/* Textarea Styling */
.text {
    resize: none;
    width: 100%;
    height: 130px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Textarea Focus Effect */
.text:focus {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* Placeholder Styling */
.text::placeholder {
    font-size: 18px;
    color: #e0e0e0;
    opacity: 1;
}

/* Counter Styling */
.counter {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    animation: slideInLeft 0.8s ease-out forwards;
}

/* Counter Text Styling */
.counter p {
    font-size: 1rem;
    color: #ffe4c4; /* Using the light carton color for consistency */
    font-weight: 600;
    position: relative;
    animation: glowText 3s ease-in-out infinite alternate; /* Add subtle glow animation */
}

/* Total Character Styling */
.total-character {
    color: #ffb3b3;
    font-weight: 600;
}

/* Remaining Characters Styling */
.remaining {
    color: #ffa07a;
    font-weight: 600;
}

/* Hover Effects */
.character-counter:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* Keyframes for Animations */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes glowText {
    0% {
        text-shadow: 0 0 10px rgba(255, 228, 196, 0.7), 0 0 20px rgba(255, 228, 196, 0.5);
    }
    100% {
        text-shadow: 0 0 20px rgba(255, 228, 196, 1), 0 0 30px rgba(255, 228, 196, 0.7);
    }
}
