:root {
    --off-white: #F5F5F5;
    --ink-dark: #1A1A1A;
    --accent-red: #D64045;
    --typewriter-font: 'Courier New', Courier, monospace;
}

body {
    background-color: var(--off-white);
    color: var(--ink-dark);
    font-family: var(--typewriter-font);
}

.typewriter-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--ink-dark);
    font-weight: bold;
}

.input-area textarea {
    background-color: white;
    border: 2px solid var(--ink-dark);
    font-family: var(--typewriter-font);
    font-size: 1.1rem;
    padding: 1rem;
    transition: border-color 0.3s ease;
    resize: vertical;
}

.input-area textarea:focus {
    border-color: var(--accent-red);
    box-shadow: none;
    outline: none;
}

/* Stats container repositioning */
.stats-container {
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-card {
    padding: 0.5rem 1rem;
    text-align: center;
    border: none;
    margin: 0;
}

.stat-card:last-child {
    border-bottom: none;
}

.stat-card h3 {
    font-size: 1.1rem;
    color: var(--accent-red);
    margin-bottom: 0.5rem;
}

.count {
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.frequent-words {
    width: 100%;
    margin-top: 1rem;
    order: 1;
}

.word-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
}

.word-item {
    background-color: var(--off-white);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    transition: opacity 0.3s ease;
    display: inline-block;
    margin: 2px;
}

.word-item:hover {
    opacity: 0.8;
    cursor: default;
}

/* Formatting Toolbar */
.formatting-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.formatting-toolbar button {
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
}

.formatting-toolbar .btn-group {
    margin-left: 0.5rem;
}

.input-area {
    margin-top: 1rem;
}

.input-area textarea {
    min-height: 200px;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
}

.action-buttons-and-words {
    margin-top: 1rem;
}

.btn {
    font-family: var(--typewriter-font);
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--ink-dark);
    border-color: var(--ink-dark);
}

.btn-primary:hover {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
}

.btn-danger {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
}

/* Animations */
@keyframes countUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.count.updating {
    animation: countUpdate 0.3s ease;
}

/* FAQ Section */
.faq-section {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
}

.faq-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    color: var(--ink-dark);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.faq-item h3:hover {
    color: var(--accent-red);
}

/* Footer */
footer {
    border-top: 1px solid #eee;
    margin-top: 3rem;
}

footer a {
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--accent-red) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .stats-container {
        margin-top: 2rem;
    }

    footer {
        text-align: center;
    }

    footer .text-md-end {
        text-align: center !important;
        margin-top: 1rem;
    }
}
