/* AI Word Counter Styles */
.aifreetools-word-counter {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
}

/* Input Section */
.aifreetools-input-section {
    margin-bottom: 30px;
}

/* Top Counter Display */
.aifreetools-top-counter-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #444;
    padding: 8px 12px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    background-color: #f8f8f8;
}

/* Bottom Counter Display */
.aifreetools-bottom-counter-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 15px;
    gap: 15px;
    font-size: 15px;
    font-weight: 500;
    color: #444;
    padding: 12px 15px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    background-color: #f8f8f8;
}

.aifreetools-counter-badge {
    display: inline-block;
    background-color: #2271b1;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    min-width: 32px;
    text-align: center;
    margin-left: 5px;
}

.aifreetools-textarea-container {
    position: relative;
    margin-bottom: 15px;
}

.aifreetools-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.aifreetools-textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.aifreetools-word-count-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 16px;
    color: #666;
    border: 1px solid #eee;
}

.aifreetools-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.aifreetools-primary-button {
    background-color: #2271b1;
    color: white;
}

.aifreetools-primary-button:hover {
    background-color: #135e96;
}

.aifreetools-secondary-button {
    background-color: #f0f0f1;
    color: #2c3338;
    border: 1px solid #c3c4c7;
}

.aifreetools-secondary-button:hover {
    background-color: #e5e5e5;
}

/* Alert Styles */
.alert {
    padding: 15px;
    margin: 10px 0;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.aifreetools-validation-message {
    margin-bottom: 15px;
}

/* CAPTCHA Container */
.aifreetools-captcha-container {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

/* Output Section */
.aifreetools-output-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.aifreetools-output-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    color: #2c3338;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Metrics Container */
.aifreetools-metrics-container {
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    background-color: white;
}

.aifreetools-metrics-header {
    background-color: #f0f0f1;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.aifreetools-metrics-header h4 {
    margin: 0;
    font-size: 16px;
    color: #2c3338;
    display: flex;
    align-items: center;
}

.aifreetools-toggle-header {
    cursor: pointer;
}

.aifreetools-toggle-header h4 {
    display: flex;
    align-items: center;
}

.aifreetools-toggle-icon {
    margin-right: 8px;
    transition: transform 0.2s;
}

.aifreetools-metrics-content {
    padding: 15px;
}

/* Metric Cards Grid */
.aifreetools-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.aifreetools-metric-card {
    background-color: #f9f9f9;
    border-radius: 4px;
    padding: 12px;
    border: 1px solid #eee;
}

.aifreetools-metric-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.aifreetools-metric-value {
    font-size: 18px;
    font-weight: 600;
    color: #2c3338;
}

/* Keyword Density Table */
.aifreetools-keyword-density-details {
    margin-top: 15px;
}

/* Pie Chart Styles */
.aifreetools-pie-chart-container {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.aifreetools-pie-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.aifreetools-pie-visualization {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: #f0f0f0;
    margin-bottom: 20px;
    overflow: hidden;
}

.aifreetools-pie-slice {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-origin: 50% 50%;
}

.aifreetools-pie-chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.aifreetools-legend-item {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.aifreetools-color-box {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 5px;
    border-radius: 3px;
}

.aifreetools-legend-label {
    font-size: 14px;
}

.aifreetools-word-types-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.aifreetools-keyword-table th,
.aifreetools-keyword-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.aifreetools-keyword-table th {
    background-color: #f0f0f1;
    font-weight: 600;
    color: #2c3338;
}

.aifreetools-keyword-table tr:hover {
    background-color: #f5f5f5;
}

/* AI Analysis Styles */
.aifreetools-ai-analysis-section {
    margin-top: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Loading Indicator Styles */
.aifreetools-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.aifreetools-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.aifreetools-loading-indicator p {
    font-size: 16px;
    color: #555;
    min-height: 24px;
    margin: 0;
    padding: 0;
    position: relative;
    text-align: center;
    width: 100%;
    max-width: 80%;
}

/* Add a subtle pulsing effect to the loading text */
@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

.aifreetools-loading-indicator p {
    animation: pulse 2s infinite ease-in-out;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Bar Chart Styles */
.aifreetools-bar-chart-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.aifreetools-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.aifreetools-bar-chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.aifreetools-bar-chart-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aifreetools-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aifreetools-bar-label {
    width: 120px;
    font-size: 14px;
    font-weight: 500;
    text-align: right;
    color: #555;
}

.aifreetools-bar-container {
    flex: 1;
    height: 24px;
    background-color: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.aifreetools-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
}

.aifreetools-bar-percentage {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.aifreetools-bar-chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.aifreetools-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.aifreetools-color-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.aifreetools-legend-label {
    font-size: 13px;
    color: #555;
}

.aifreetools-ai-section h5 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2271b1;
    font-weight: 600;
}

.aifreetools-ai-section h6 {
    font-size: 16px;
    margin: 15px 0 10px;
    color: #333;
}

.aifreetools-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.aifreetools-error-message {
    color: #d63638;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Word Classification */
.aifreetools-pie-chart-container {
    height: 200px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.aifreetools-word-types-table,
.aifreetools-redundancy-table,
.aifreetools-topic-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.aifreetools-word-types-table th,
.aifreetools-redundancy-table th,
.aifreetools-topic-table th {
    background-color: #f0f0f1;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #ddd;
}

.aifreetools-word-types-table td,
.aifreetools-redundancy-table td,
.aifreetools-topic-table td {
    padding: 8px 10px;
    border: 1px solid #ddd;
}

.aifreetools-word-types-table tr:nth-child(even),
.aifreetools-redundancy-table tr:nth-child(even),
.aifreetools-topic-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.aifreetools-expansion-topics {
    margin-top: 15px;
}

.aifreetools-expansion-topics ul {
    margin-left: 20px;
    list-style-type: disc;
}

.aifreetools-expansion-topics li {
    margin-bottom: 5px;
    line-height: 1.5;
}

/* Export Options */
.aifreetools-export-options {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.aifreetools-export-options h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #2c3338;
}

.aifreetools-export-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.aifreetools-export-buttons .dashicons {
    margin-right: 5px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .aifreetools-metrics-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .aifreetools-metric-value {
        font-size: 16px;
    }
    
    .aifreetools-export-buttons {
        flex-direction: column;
    }
    
    .aifreetools-export-buttons button {
        width: 100%;
    }
}

/* Loading Spinner */
.spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

div#density_analysis_section {
    padding-top: 20px;
}

.aifreetools-topic-density {
    padding-top: 20px;
}