* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    background-color: #f0f0f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #333;
}

/* Main Container */
.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 600px;
    max-width: 100%;
    text-align: center;
    transition: all 0.3s ease-in-out;
}

.container:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* Title */
h1 {
    font-weight: 600;
    font-size: 28px;
    margin-bottom: 30px;
    color: #333;
}

/* Textarea for input */
textarea {
    width: 100%;
    height: 180px;
    border: none;
    border-radius: 10px;
    background-color: #f8f8f8;
    padding: 20px;
    font-size: 16px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

textarea:focus {
    outline: none;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Stats Section */
.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-item {
    flex: 1;
}

.stat-label {
    font-size: 16px;
    font-weight: 500;
    color: #555;
}

/* Error message */
.error-msg {
    color: #e74c3c;
    background-color: #ffecec;
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    font-weight: 500;
    visibility: hidden; /* Hidden by default, shown on error */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.error-msg.active {
    visibility: visible;
    opacity: 1;
}

/* Histogram Section */
#histogram {
    margin-top: 20px;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

#histogram p {
    padding: 5px 0;
    transition: background-color 0.2s ease;
}

#histogram p:hover {
    background-color: #f5f5f5;
}

/* Smooth transitions */
textarea, .container, .stats, p, #histogram {
    transition: all 0.2s ease-in-out;
}