/* Word Cloud Generator Custom Styles */

/* Global Improvements */
#word-cloud-generator {
    font-family: "Inter", system-ui, sans-serif;
}

/* Simple Tab Navigation */
.input-tab-btn {
    position: relative;
    transition: all 0.2s ease;
    border-bottom-width: 2px;
}

.input-tab-btn.active {
    border-bottom-color: #2563eb;
    color: #2563eb;
    background-color: #f8fafc;
}

.input-tab-btn:not(.active) {
    border-bottom-color: transparent;
    color: #6b7280;
}

.input-tab-btn:not(.active):hover {
    color: #374151;
    background-color: #f9fafb;
}

/* Tab Content */
.input-tab-content {
    transition: opacity 0.2s ease;
}

/* File Drop Zone Enhancement */
#file-drop-zone {
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

#file-drop-zone::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.6s ease;
}

#file-drop-zone.dragover {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: scale(1.02);
}

#file-drop-zone.dragover::before {
    left: 100%;
}

/* Enhanced Range Sliders */
input[type="range"] {
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
}

input[type="range"]::-webkit-slider-track {
    height: 8px;
    background: linear-gradient(to right, #e5e7eb 0%, #cbd5e1 100%);
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    border: 3px solid white;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

input[type="range"]::-moz-range-track {
    height: 8px;
    background: linear-gradient(to right, #e5e7eb 0%, #cbd5e1 100%);
    border-radius: 4px;
    border: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-moz-range-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    cursor: pointer;
    border: 3px solid white;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

input[type="range"]::-moz-range-thumb:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Range Value Display Enhancement */
.range-value {
    display: inline-block;
    min-width: 2rem;
    text-align: center;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    border: 1px solid #bfdbfe;
}

/* Word Cloud Container Enhancement */
#wordcloud-container {
    min-height: 500px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    transition: all 0.3s ease-in-out;
}

#wordcloud-container:hover {
    border-color: #94a3b8;
}

#wordcloud-container.has-content {
    border-style: solid;
    border-color: #2563eb;
    background: white;
}

#wordcloud-container canvas {
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    display: block;
    margin: 0;
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 0;
}

/* Word Cloud Container */
#wordcloud-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
    background-color: #ffffff;
}

#wordcloud-container canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
}

#wordcloud-container.has-content {
    background-color: #ffffff;
}

#wordcloud-container canvas:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* HTML5 Word Cloud Styling */
.word-cloud-html {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: visible;
}

.word-cloud-html .word-item {
    position: absolute;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.8);
}

.word-cloud-html .word-item:hover {
    filter: brightness(1.2);
    z-index: 10;
    position: absolute;
}

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Word Tooltip */
.word-tooltip {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Empty State Styling */
.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #9ca3af;
    transition: opacity 0.3s ease;
}

.empty-state.hidden {
    opacity: 0;
    pointer-events: none;
}

.empty-state svg {
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* Statistics Grid Enhancement */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    display: block;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Frequency Table Enhancement */
.frequency-table {
    max-height: 500px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.frequency-table::-webkit-scrollbar {
    width: 8px;
}

.frequency-table::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.frequency-table::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.frequency-table::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.frequency-table table {
    width: 100%;
    border-collapse: collapse;
}

.frequency-table th,
.frequency-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.frequency-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.frequency-table tr:hover {
    background-color: #f8fafc;
}

.frequency-table .word-cell {
    font-weight: 600;
    color: #1e40af;
}

.frequency-table .count-cell {
    font-weight: 500;
    color: #059669;
}

.frequency-bar {
    height: 6px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 3px;
    margin-top: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

/* Word Frequency Visualization */
.word-item {
    display: inline-block;
    margin: 3px 5px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 25px;
    border: 1px solid #93c5fd;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.875rem;
}

.word-item:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Color Scheme Previews */
.color-scheme-preview {
    display: inline-flex;
    margin-left: 12px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.color-scheme-preview .color-swatch {
    width: 16px;
    height: 16px;
}

/* Enhanced Buttons */
.export-btn {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    margin: 0 0.25rem;
}

.export-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* Loading Animation Enhancement */
#loading-state.show {
    display: flex !important;
}

.loading-overlay {
    backdrop-filter: blur(8px);
}

.loading-content {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Indicators */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    stroke-dasharray: 251.3;
    stroke-dashoffset: 251.3;
    transition: stroke-dashoffset 0.35s;
}

/* Toast Notifications Enhancement */
#error-toast,
#success-toast {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#error-toast.show,
#success-toast.show {
    transform: translateX(0) !important;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    #wordcloud-container {
        min-height: 300px;
    }

    .frequency-table th,
    .frequency-table td {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 640px) {
    .input-tab-btn {
        font-size: 0.75rem;
        padding: 0.75rem 0.5rem;
    }

    .input-tab-btn svg {
        width: 1rem;
        height: 1rem;
    }
}
.progress-step {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-step.active .step-icon {
    background: #2563eb;
    color: white;
}

.progress-step.completed .step-icon {
    background: #10b981;
    color: white;
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1rem;
    transition: all 0.2s ease;
}

/* Toast Notifications */
.toast-show {
    transform: translateX(0) !important;
}

/* Export Options */
.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.export-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.export-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.export-btn:active {
    background: #e5e7eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    #wordcloud-container {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .export-options {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Indicators */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .stat-card {
        border-color: #000;
    }

    .frequency-table th {
        background-color: #000;
        color: #fff;
    }

    .word-item {
        border-color: #000;
        background: #fff;
    }
}

/* Enhanced Modal Animations */
.fixed.inset-0 > div {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Toast Notifications Enhancement */
#error-toast,
#success-toast {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#error-toast.toast-show,
#success-toast.toast-show {
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Default hidden state */
#error-toast:not(.toast-show),
#success-toast:not(.toast-show) {
    transform: translateX(100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Quick Exclusion Words Enhancement */
.exclusion-word.bg-blue-100 {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    border-color: #93c5fd !important;
}

/* Enhanced Loading Animation */
.loading-content {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}
