/*
Plugin Name: Word/Character Counter
Description: Real-time word and character counter for your WordPress content, running entirely in the browser.
*/

/* Ensure Tailwind CSS CDN is loaded by your theme or plugin.
   If not, you can add it via wp_enqueue_style in the PHP file:
   wp_enqueue_style('tailwind-cdn', 'https://cdn.tailwindcss.com');
   or add it directly in your theme.
*/

/* Apply Inter font */
body {
    font-family: 'Inter', sans-serif;
}

/* Plugin container styling */
.my-word-character-counter-plugin-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 15px; /* Rounded corners */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); /* Deep shadow */
    width: 100%;
    max-width: 800px; /* Max width */
    margin: 20px auto; /* Center align and add top/bottom margin */
    box-sizing: border-box;
    border: 1px solid #e0e0e0; /* Light border */
}

/* Character Counter Title Styling */
/* This ensures the title is centered and visually appealing */
.my-word-character-counter-plugin-container h2 {
    text-align: center; /* Explicitly center the text */
    margin-bottom: 40px; /* Increased space below the title to prevent cutting off */
}

.my-word-character-counter-plugin-container h2 span {
    display: block; /* Ensure span takes full width for centering */
    font-size: 4rem; /* Make font size larger for prominence */
    font-weight: 800; /* Extra bold font */
    /* Gradient text color - these are Tailwind-like properties,
       but can be replicated with standard CSS if Tailwind is not present */
    background: linear-gradient(135deg, #6d28d9, #a78bfa); /* Purple to lighter purple gradient */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent; /* Fallback for browsers not supporting background-clip: text */
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2); /* Add a subtle text shadow */
    transition: all 0.3s ease-in-out; /* Smooth transition for hover effects */
    line-height: 1.2; /* Ensure enough line height for the large font size */
}

.my-word-character-counter-plugin-container h2 span:hover {
    transform: scale(1.02); /* Slightly enlarge on hover */
    text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3); /* Deeper shadow on hover */
}


/* Text area styling */
.my-word-character-counter-plugin-container textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #a78bfa; /* Purple border */
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical; /* Resize vertically only */
    outline: none;
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    box-sizing: border-box;
    margin-bottom: 20px; /* Add space below textarea */
}

.my-word-character-counter-plugin-container textarea:focus {
    border-color: #8b5cf6; /* Darker purple on focus */
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2); /* Light shadow on focus */
}

/* Count Button Styling */
.count-button {
    display: block; /* Make it a block element to take full width */
    width: 100%; /* Full width */
    padding: 15px 25px;
    background: linear-gradient(135deg, #6d28d9, #8b5cf6); /* Gradient background */
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(109, 40, 217, 0.3); /* Button shadow */
    margin-bottom: 30px; /* Space below button */
    text-transform: uppercase; /* Uppercase text */
    letter-spacing: 1px;
}

.count-button:hover {
    background: linear-gradient(135deg, #4c1d95, #6d28d9); /* Darker gradient on hover */
    box-shadow: 0 8px 20px rgba(109, 40, 217, 0.4); /* Deeper shadow on hover */
    transform: translateY(-2px); /* Slight lift on hover */
}

.count-button:active {
    transform: translateY(0); /* Press effect */
    box-shadow: 0 3px 10px rgba(109, 40, 217, 0.2);
}


/* Counter display styling */
.my-word-character-counter-display {
    display: grid; /* Use CSS Grid for better control over multiple items */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Responsive grid columns */
    gap: 15px; /* Gap between counters */
    margin-top: 25px;
}

.my-word-character-counter-item {
    background-color: #ede9fe; /* Light purple background */
    padding: 20px 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); /* Light shadow */
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid #dcd0ff; /* Light purple border */
}

.my-word-character-counter-item:hover {
    transform: translateY(-5px) scale(1.02); /* Lift and slightly enlarge on hover */
    background-color: #dbd2fe; /* Darker purple on hover */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); /* Deeper shadow on hover */
}

.my-word-character-counter-item strong {
    display: block;
    font-size: 2.5rem; /* Counter number size */
    color: #6d28d9; /* Dark purple color */
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.my-word-character-counter-item:hover strong {
    color: #4c1d95; /* Even darker purple on hover */
}

.my-word-character-counter-item span {
    font-size: 1.1rem; /* Label size */
    color: #5b21b6; /* Medium purple */
    font-weight: 600;
}

/* Media query for smaller screens */
@media (max-width: 640px) {
    .my-word-character-counter-plugin-container {
        padding: 20px;
    }
    .my-word-character-counter-display {
        grid-template-columns: 1fr; /* Single column layout on small screens */
    }
    .my-word-character-counter-item {
        width: 100%;
        max-width: 250px; /* Max width in column layout */
        margin: 0 auto; /* Center items in column layout */
    }
    .my-word-character-counter-item strong {
        font-size: 2rem;
    }
    .my-word-character-counter-item span {
        font-size: 1rem;
    }
}
