/**
 * Word Counter Tool Styles
 * Version: 2.0.0
 */

/* ========== Base Styles ========== */
.wct-container {
    max-width: 100%;
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* ========== Themes ========== */
/* Light Theme */
.wct-theme-light {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #2d3748;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.wct-theme-light .wct-textarea {
    background: white;
    border: 2px solid #e2e8f0;
    color: #1a202c;
}

/* Dark Theme */
.wct-theme-dark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.wct-theme-dark .wct-textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.wct-theme-dark .wct-textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Blue Theme */
.wct-theme-blue {
    background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
    color: white;
}

/* Green Theme */
.wct-theme-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

/* Purple Theme */
.wct-theme-purple {
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    color: white;
}

/* Minimal Theme */
.wct-theme-minimal {
    background: white;
    color: #333;
    box-shadow: none;
    border: 1px solid #e0e0e0;
}

/* ========== Layouts ========== */
.wct-layout-compact .wct-stats-grid {
    grid-template-columns: repeat(3, 1fr);
}

.wct-layout-compact .wct-keywords,
.wct-layout-compact .wct-progress-bars {
    display: none;
}

.wct-layout-extended .wct-stats-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* ========== Header ========== */
.wct-header {
    padding: 25px 25px 10px 25px;
    text-align: center;
}

.wct-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
}

.wct-theme-light .wct-title {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== Main Content ========== */
.wct-main {
    padding: 20px 25px 25px 25px;
}

/* Textarea */
.wct-textarea {
    width: 100%;
    padding: 20px;
    border-radius: 15px;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.wct-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

/* Stats Panel */
.wct-stats-panel {
    margin-top: 25px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.wct-theme-minimal .wct-stats-panel {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
}

/* Stats Grid */
.wct-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.wct-stat-item {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wct-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.25);
}

.wct-stat-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.wct-stat-value {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
}

/* Progress Bars */
.wct-progress-bars {
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.wct-progress-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.wct-progress-label {
    min-width: 100px;
    font-size: 0.9rem;
}

.wct-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.wct-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.wct-progress-value {
    min-width: 50px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Keywords Section */
.wct-keywords {
    margin: 20px 0;
}

.wct-keywords h4 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    opacity: 0.9;
}

.wct-keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wct-keyword-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.wct-keyword-tag:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.wct-keyword-count {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 5px;
}

/* Footer Tools */
.wct-footer-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.wct-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wct-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.wct-btn:active {
    transform: translateY(0);
}

.wct-save-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.wct-stat-value.updating {
    animation: pulse 0.3s ease;
    color: #667eea;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wct-stat-item {
    animation: slideIn 0.5s ease forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wct-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wct-footer-tools {
        flex-wrap: wrap;
    }
    
    .wct-save-status {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .wct-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .wct-title {
        font-size: 1.5rem;
    }
    
    .wct-progress-item {
        flex-wrap: wrap;
    }
    
    .wct-progress-label {
        width: 100%;
    }
}

/* Accessibility */
.wct-textarea:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .wct-stat-item,
    .wct-stat-value,
    .wct-btn {
        transition: none;
    }
    
    .wct-stat-item:hover {
        transform: none;
    }
}

/* WordPress Admin Bar Compatibility */
.admin-bar .wct-container {
    margin-top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .wct-container {
        margin-top: 46px;
    }
}

/* Print Styles */
@media print {
    .wct-container {
        box-shadow: none;
        border: 1px solid #000;
        background: white;
        color: black;
    }
    
    .wct-btn,
    .wct-save-status {
        display: none;
    }
}