/* CSS Reset and Base Styles */
.word-counter-tool * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.word-counter-tool {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #4cc9f0;
    --text-color: #333;
    --light-gray: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

.word-counter-tool {
    color: var(--text-color);
    line-height: 1.6;
    background-color: #fff;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Styles */
.word-counter-tool header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.word-counter-tool h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.word-counter-tool .subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Layout */
.word-counter-tool .container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .word-counter-tool .container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .word-counter-tool .container {
        grid-template-columns: 2fr 1fr;
    }
}

/* Input Section */
.word-counter-tool .input-section {
    display: flex;
    flex-direction: column;
}

.word-counter-tool textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s;
}

.word-counter-tool textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.word-counter-tool .input-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.word-counter-tool .btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.word-counter-tool .btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.word-counter-tool .btn-primary:hover {
    background-color: var(--secondary-color);
}

.word-counter-tool .btn-secondary {
    background-color: var(--light-gray);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.word-counter-tool .btn-secondary:hover {
    background-color: #e9ecef;
}

/* Stats Section */
.word-counter-tool .stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.word-counter-tool .stat-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    box-shadow: var(--shadow);
}

.word-counter-tool .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.word-counter-tool .stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* Results Section */
.word-counter-tool .results-section {
    margin-top: 30px;
}

.word-counter-tool .section-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.word-counter-tool .keyword-section {
    margin-top: 20px;
}

.word-counter-tool .keyword-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.word-counter-tool .keyword-tab {
    padding: 10px 15px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.word-counter-tool .keyword-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.word-counter-tool .keyword-table {
    width: 100%;
    border-collapse: collapse;
}

.word-counter-tool .keyword-table th,
.word-counter-tool .keyword-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.word-counter-tool .keyword-table th {
    background-color: var(--light-gray);
    font-weight: 600;
}

.word-counter-tool .keyword-table tr:hover {
    background-color: #f5f5f5;
}

.word-counter-tool .keyword {
    font-weight: 600;
}

/* Footer */
.word-counter-tool footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .word-counter-tool .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .word-counter-tool .input-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .word-counter-tool .btn {
        width: 100%;
    }
}