/* ====================================
   Word Counter - Complete Styling
   ==================================== */

/* Tool Page Common Styles */
.tool-page {
    padding-top: 0;
}

.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #666;
    transition: all 0.3s;
}

.breadcrumb a:hover {
    color: #3b82f6;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #ddd;
}

.breadcrumb .current {
    color: #333;
    font-weight: 600;
}

.tool-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tool-header::before {
    content: '📊📝';
    position: absolute;
    font-size: 300px;
    opacity: 0.05;
    top: -50px;
    right: -50px;
    animation: rotate 20s linear infinite;
}

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

.tool-header-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tool-icon-large {
    font-size: 72px;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.tool-header h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.tool-subtitle {
    font-size: 20px;
    opacity: 0.95;
    margin-bottom: 25px;
    line-height: 1.6;
}

.tool-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 16px;
}

.meta-separator {
    opacity: 0.5;
}

.tool-content {
    padding: 60px 20px;
    background: #f8f9fa;
}

/* Counter Root Container */
.counter-root {
    max-width: 1400px;
    margin: 0 auto;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 2px solid transparent;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--card-color), var(--card-color-light));
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    border-color: var(--card-color);
}

.stat-card.primary {
    --card-color: #3b82f6;
    --card-color-light: #60a5fa;
}

.stat-card.success {
    --card-color: #10b981;
    --card-color-light: #34d399;
}

.stat-card.info {
    --card-color: #06b6d4;
    --card-color-light: #22d3ee;
}

.stat-card.warning {
    --card-color: #f59e0b;
    --card-color-light: #fbbf24;
}

.stat-card.purple {
    --card-color: #8b5cf6;
    --card-color-light: #a78bfa;
}

.stat-card.danger {
    --card-color: #ef4444;
    --card-color-light: #f87171;
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    color: #1f2937;
    margin-bottom: 8px;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Controls Section */
.counter-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    background: #f3f4f6;
    color: #1f2937;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-ghost {
    background: white;
    border: 2px solid rgba(0,0,0,0.1);
    color: #1f2937;
}

.btn-ghost:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 8px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 10px;
}

.toggle-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.3s;
}

.toggle-btn.active {
    background: white;
    color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.toggle-btn:hover:not(.active) {
    color: #3b82f6;
}

/* Editor Section */
.editor-section {
    margin-bottom: 30px;
}

.editor-wrapper {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 2px solid rgba(59, 130, 246, 0.1);
}

.text-editor {
    width: 100%;
    min-height: 500px;
    padding: 20px;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #1f2937;
    background: #f9fafb;
    resize: vertical;
    transition: all 0.3s;
}

.text-editor:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: white;
}

.text-editor::placeholder {
    color: #9ca3af;
    line-height: 1.8;
}

/* Analysis Section */
.analysis-section {
    margin-bottom: 30px;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.analysis-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 2px solid rgba(59, 130, 246, 0.1);
}

.analysis-card.full-width {
    grid-column: 1 / -1;
}

.analysis-card h3 {
    color: #3b82f6;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Detail Stats */
.detail-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
}

.detail-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 14px;
}

.detail-value {
    font-weight: 700;
    color: #1f2937;
    font-size: 16px;
}

/* Keywords List */
.keywords-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.keyword-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
}

.keyword-word {
    font-weight: 600;
    color: #1e40af;
    text-transform: capitalize;
}

.keyword-count {
    background: #3b82f6;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.placeholder-text {
    color: #9ca3af;
    text-align: center;
    padding: 30px;
    font-style: italic;
}

/* Character Distribution */
.char-distribution {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dist-item {
    display: grid;
    grid-template-columns: 120px 1fr 80px;
    gap: 15px;
    align-items: center;
}

.dist-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 14px;
}

.dist-bar {
    height: 24px;
    background: #f3f4f6;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.dist-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, var(--fill-color), var(--fill-color-light));
}

.dist-fill.letters {
    --fill-color: #3b82f6;
    --fill-color-light: #60a5fa;
}

.dist-fill.numbers {
    --fill-color: #10b981;
    --fill-color-light: #34d399;
}

.dist-fill.punctuation {
    --fill-color: #f59e0b;
    --fill-color-light: #fbbf24;
}

.dist-fill.spaces {
    --fill-color: #8b5cf6;
    --fill-color-light: #a78bfa;
}

.dist-value {
    font-weight: 700;
    color: #1f2937;
    text-align: right;
}

/* Examples Section */
.examples-section {
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 15px;
    border: 2px solid rgba(59, 130, 246, 0.2);
}

.examples-section h4 {
    color: #1e40af;
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 700;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.example-card {
    padding: 20px;
    background: white;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.example-card strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 8px;
}

.example-card p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 5px solid #f59e0b;
    padding: 30px;
    border-radius: 15px;
}

.info-box h4 {
    color: #b45309;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    line-height: 1.7;
    font-size: 14px;
    color: #555;
    border: 2px solid rgba(245, 158, 11, 0.2);
}

.info-item strong {
    color: #b45309;
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

/* SEO Content Section */
.seo-content {
    padding: 80px 20px;
    background: white;
}

.content-article {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.content-article h2 {
    font-size: 32px;
    font-weight: 800;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #333;
}

.content-article h2:first-child {
    margin-top: 0;
}

.content-article h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #333;
}

.content-article p {
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.content-article strong {
    color: #333;
    font-weight: 700;
}

/* Related Tools */
.related-tools {
    max-width: 900px;
    margin: 60px auto 0;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
}

.related-tools h3 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    text-align: center;
    color: #3b82f6;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.related-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 25px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
}

.related-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #3b82f6;
}

.related-tool-card .tool-icon {
    font-size: 42px;
}

.related-tool-card .tool-name {
    font-weight: 700;
    color: #333;
    font-size: 16px;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 15px 22px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    font-size: 15px;
    font-weight: 600;
    z-index: 10000;
    animation: slideInUp 0.3s ease-out;
}

.notification-toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 32px;
    }
    
    .tool-subtitle {
        font-size: 16px;
    }
    
    .tool-icon-large {
        font-size: 52px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .counter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .view-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .text-editor {
        min-height: 400px;
        font-size: 15px;
    }
    
    .dist-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .content-article h2 {
        font-size: 26px;
    }
    
    .content-article h3 {
        font-size: 20px;
    }
}

@media (max-width: 520px) {
    .tool-header {
        padding: 40px 20px;
    }
    
    .tool-header h1 {
        font-size: 28px;
    }
    
    .tool-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .meta-separator {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .text-editor {
        min-height: 300px;
        font-size: 14px;
    }
    
    .notification-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        font-size: 14px;
    }
}

/* Custom Scrollbar */
.text-editor::-webkit-scrollbar,
.keywords-list::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.text-editor::-webkit-scrollbar-track,
.keywords-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.text-editor::-webkit-scrollbar-thumb,
.keywords-list::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 5px;
}

.text-editor::-webkit-scrollbar-thumb:hover,
.keywords-list::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Print Styles */
@media print {
    .tool-header,
    .counter-controls,
    .examples-section,
    .related-tools,
    .notification-toast,
    .view-toggle {
        display: none;
    }
    
    .text-editor {
        border: 1px solid #000;
    }
}