/* English Word Counter - Main Styles */
.ewc-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ewc-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e1e5e9;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ewc-card:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.ewc-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.ewc-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
}

.ewc-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.ewc-header i {
    margin-right: 10px;
}

.ewc-input-section {
    padding: 30px;
}

.ewc-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.ewc-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ewc-controls {
    padding: 0 30px 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ewc-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.ewc-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.ewc-btn-primary {
    background: #667eea;
    color: white;
}

.ewc-btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.ewc-btn-secondary {
    background: #6c757d;
    color: white;
}

.ewc-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.ewc-btn-success {
    background: #28a745;
    color: white;
}

.ewc-btn-success:hover {
    background: #218838;
    transform: translateY(-1px);
}

.ewc-btn-info {
    background: #17a2b8;
    color: white;
}

.ewc-btn-info:hover {
    background: #138496;
    transform: translateY(-1px);
}

.ewc-results-section {
    padding: 0 30px 30px;
}

.ewc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.ewc-stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.ewc-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ewc-stat-icon {
    font-size: 24px;
    color: #667eea;
    margin-bottom: 8px;
}

.ewc-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 4px;
}

.ewc-stat-label {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.ewc-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.ewc-word-frequency {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e9ecef;
}

.ewc-word-frequency h3 {
    margin: 0 0 16px 0;
    color: #2d3748;
    font-size: 18px;
}

.ewc-word-frequency h3 i {
    margin-right: 8px;
    color: #667eea;
}

.ewc-frequency-list {
    display: grid;
    gap: 8px;
}

.ewc-frequency-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.ewc-frequency-item:hover {
    background: #edf2f7;
    transform: translateX(4px);
}

.ewc-frequency-word {
    font-weight: 500;
    color: #2d3748;
}

.ewc-frequency-count {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Notifications */
.ewc-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
}

.ewc-notification-show {
    transform: translateX(0);
    opacity: 1;
}

.ewc-notification-success {
    background: #28a745;
}

.ewc-notification-error {
    background: #dc3545;
}

.ewc-notification-info {
    background: #17a2b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ewc-container {
        padding: 10px;
    }
    
    .ewc-header {
        padding: 20px;
    }
    
    .ewc-header h2 {
        font-size: 24px;
    }
    
    .ewc-input-section,
    .ewc-controls,
    .ewc-results-section {
        padding: 20px;
    }
    
    .ewc-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ewc-controls,
    .ewc-actions {
        flex-direction: column;
    }
    
    .ewc-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .ewc-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .ewc-stat-value {
        font-size: 24px;
    }
    
    .ewc-header h2 {
        font-size: 20px;
    }
    
    .ewc-header p {
        font-size: 14px;
    }
}

/* Loading state */
.ewc-btn-loading {
    position: relative;
    color: transparent !important;
}

.ewc-btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: ewc-spin 1s linear infinite;
}

@keyframes ewc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus styles for accessibility */
.ewc-btn:focus-visible,
.ewc-textarea:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ewc-card {
        border: 2px solid;
    }
    
    .ewc-stat-card {
        border: 1px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ewc-card,
    .ewc-stat-card,
    .ewc-btn,
    .ewc-frequency-item,
    .ewc-notification {
        transition: none;
    }
    
    .ewc-btn:hover,
    .ewc-stat-card:hover,
    .ewc-frequency-item:hover {
        transform: none;
    }
}