/* Syllable Counter Advanced Styling */

/* Enhanced animations and transitions */
.syllable-counter-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

/* Metric cards with sophisticated animations */
.metric-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(203, 213, 225, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.6s;
}

.metric-card:hover::before {
    left: 100%;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.metric-value {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-feature-settings: "tnum";
    transition: all 0.3s ease;
}

.metric-card:hover .metric-value {
    transform: scale(1.05);
}

/* Advanced progress bars with gradients */
.progress-container {
    background: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    height: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 8px;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Syllable distribution chart */
.syllable-distribution {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.syllable-category {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.syllable-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.syllable-category-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.syllable-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.syllable-percentage {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* Word complexity indicators */
.complexity-indicator {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.complexity-simple {
    background: #dcfce7;
    color: #166534;
}

.complexity-moderate {
    background: #fef3c7;
    color: #92400e;
}

.complexity-complex {
    background: #fed7d7;
    color: #c53030;
}

.complexity-very-complex {
    background: #e2e8f0;
    color: #1e293b;
}

/* Phonetic analysis visualization */
.phonetic-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.phonetic-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.phonetic-item:hover {
    background: #f8fafc;
    border-color: #3b82f6;
}

.phonetic-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.phonetic-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

/* Word breakdown table */
.word-breakdown {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    max-height: 400px;
    overflow-y: auto;
}

.word-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
}

.word-item:hover {
    background: #f8fafc;
}

.word-text {
    font-weight: 600;
    color: #1e293b;
}

.syllable-breakdown {
    font-family: "Courier New", monospace;
    color: #3b82f6;
    font-size: 0.875rem;
}

.syllable-count-badge {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Readability metrics */
.readability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.readability-metric {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.readability-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.readability-score {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.readability-level {
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Reading level color coding */
.level-very-easy {
    color: #10b981;
}
.level-easy {
    color: #059669;
}
.level-fairly-easy {
    color: #3b82f6;
}
.level-standard {
    color: #6366f1;
}
.level-fairly-difficult {
    color: #f59e0b;
}
.level-difficult {
    color: #ef4444;
}
.level-very-difficult {
    color: #dc2626;
}

/* Linguistic patterns */
.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.pattern-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
}

.pattern-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.pattern-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pattern-item {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pattern-item:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Interactive controls */
.control-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(203, 213, 225, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.option-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    transition: background 0.3s ease;
    cursor: pointer;
}

.toggle-switch.active {
    background: #3b82f6;
}

.toggle-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Sample text buttons */
.sample-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.sample-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sample-btn:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Export and action buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Notification styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #10b981;
}
.notification.error {
    background: #ef4444;
}
.notification.warning {
    background: #f59e0b;
}
.notification.info {
    background: #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .metric-card {
        margin-bottom: 1rem;
    }

    .pattern-grid {
        grid-template-columns: 1fr;
    }

    .readability-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .word-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }

    .sample-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .control-panel {
        padding: 1rem;
    }

    .phonetic-chart {
        grid-template-columns: repeat(2, 1fr);
    }

    .sample-buttons {
        grid-template-columns: 1fr;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for accessibility */
.metric-card:focus,
.action-btn:focus,
.sample-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom scrollbar */
.word-breakdown::-webkit-scrollbar {
    width: 8px;
}

.word-breakdown::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.word-breakdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.word-breakdown::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
