/* Word Counter Tool Styles */

/* Tool Container - Full Page Layout */
.word-counter-tool {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 0;
    margin: 0;
}

.tool-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 1rem 0;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: rgb(20, 19, 19);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.tool-description {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Counter Interface */
.counter-interface {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

/* Text Input Section */
.text-input-section {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.input-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.paste-btn {
    background: var(--primary-color);
    color: var(--white);
}

.paste-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.clear-btn {
    background: #ef4444;
    color: var(--white);
}

.clear-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.25);
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.textarea-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease-in-out;
    background: var(--white);
}

.textarea-container:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.textarea-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#textInput {
    width: 100%;
    min-height: 400px;
    padding: 1.5rem;
    border: none;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-color);
    background: transparent;
    resize: vertical;
    transition: all 0.2s ease-in-out;
}

#textInput::placeholder {
    color: #9ca3af;
    font-style: normal;
    font-weight: 400;
    opacity: 1;
}

.textarea-footer {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quick-stats {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Statistics Section */
.statistics-section {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
}

.statistics-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2rem;
    text-align: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

/* Primary stat card (Words) - Green theme */
.stat-card.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    border-color: var(--primary-color);
}

/* Characters stat card - Blue theme */
.stat-card.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: var(--white);
    border-color: #3b82f6;
}

/* Characters (no spaces) stat card - Purple theme */
.stat-card.purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: var(--white);
    border-color: #8b5cf6;
}

/* Paragraphs stat card - Orange theme */
.stat-card.orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: var(--white);
    border-color: #f59e0b;
}

/* Sentences stat card - Teal theme */
.stat-card.teal {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: var(--white);
    border-color: #14b8a6;
}

/* Reading Time stat card - Red theme */
.stat-card.red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: var(--white);
    border-color: #ef4444;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Colored stat card icons */
.stat-card.primary .stat-icon,
.stat-card.blue .stat-icon,
.stat-card.purple .stat-icon,
.stat-card.orange .stat-icon,
.stat-card.teal .stat-icon,
.stat-card.red .stat-icon {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 0.25rem;
}

/* Colored stat card numbers */
.stat-card.primary .stat-number,
.stat-card.blue .stat-number,
.stat-card.purple .stat-number,
.stat-card.orange .stat-number,
.stat-card.teal .stat-number,
.stat-card.red .stat-number {
    color: var(--white);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Colored stat card labels */
.stat-card.primary .stat-label,
.stat-card.blue .stat-label,
.stat-card.purple .stat-label,
.stat-card.orange .stat-label,
.stat-card.teal .stat-label,
.stat-card.red .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Additional Stats */
.additional-stats {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.stat-label-inline {
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 500;
}

.stat-value {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Tool Features */
.tool-features {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 3rem;
}

.tool-features h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: var(--bg-light);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .tool-container {
        max-width: 1200px;
        padding: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .counter-interface {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .tool-header h1 {
        font-size: 2.25rem;
    }
}

@media (max-width: 768px) {
    .word-counter-tool {
        padding: 0;
    }

    .tool-container {
        padding: 1rem;
    }

    .tool-header {
        margin-bottom: 1.5rem;
        padding: 0.5rem 0;
    }

    .tool-header h1 {
        font-size: 1.875rem;
    }

    .tool-description {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .input-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding: 1rem 1.5rem;
    }

    .header-actions {
        justify-content: center;
        gap: 0.5rem;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
        min-height: 44px;
    }

    #textInput {
        min-height: 300px;
        padding: 1.25rem;
        font-size: 1rem;
        line-height: 1.5;
    }

    .textarea-container {
        border-radius: 10px;
    }

    .statistics-section {
        padding: 1.5rem;
    }

    .stat-card {
        padding: 1rem;
        gap: 0.75rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .textarea-footer {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .tool-container {
        padding: 0.5rem;
    }

    .tool-header h1 {
        font-size: 1.625rem;
    }

    .tool-description {
        font-size: 0.9rem;
    }

    #textInput {
        padding: 1rem;
        min-height: 250px;
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .textarea-container {
        border-radius: 8px;
        border-width: 1.5px;
    }

    .textarea-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .input-header {
        padding: 1rem;
    }

    .statistics-section {
        padding: 1rem;
    }

    .stat-card {
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        margin: 0 auto;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .feature-item {
        padding: 1rem;
    }

    .feature-item i {
        font-size: 1.5rem;
    }

    .feature-item h3 {
        font-size: 0.9rem;
    }

    .feature-item p {
        font-size: 0.8rem;
    }
}

/* Animation for stat updates */
.stat-number {
    transition: all 0.3s ease;
}

.stat-number.updated {
    transform: scale(1.1);
    color: var(--primary-color);
}

/* Updated animation for colored stat cards */
.stat-card.primary .stat-number.updated,
.stat-card.blue .stat-number.updated,
.stat-card.purple .stat-number.updated,
.stat-card.orange .stat-number.updated,
.stat-card.teal .stat-number.updated,
.stat-card.red .stat-number.updated {
    color: var(--white);
}

/* Focus styles for accessibility */
.action-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.clear-btn:focus {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

/* Enhanced accessibility */
#textInput:focus {
    outline: none;
}

.textarea-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Loading and transition states */
.stat-number.loading {
    opacity: 0.6;
    transform: scale(0.95);
}

/* Improved hover effects */
.text-input-section:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease-in-out;
}

.statistics-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

/* Better visual feedback for interactions */
.clear-btn:active {
    transform: translateY(1px);
}

/* Smooth transitions for all interactive elements */
.text-input-section,
.statistics-section,
.tool-features {
    transition: var(--transition);
}

/* Enhanced stat card animations */
.stat-card:hover .stat-icon {
    transform: scale(1.1);
    transition: var(--transition);
}

.stat-card:hover .stat-number {
    transform: scale(1.05);
    transition: var(--transition);
}

/* Improved typography for better readability */
.stat-label,
.stat-label-inline {
    letter-spacing: 0.025em;
}

.stat-number {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.025em;
}
