/* N-gram Generator Custom Styles */

/* Tab styles */
.tab-button {
    position: relative;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    margin: 0.25rem;
}

.tab-button:hover {
    color: #374151;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.tab-button.active {
    color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

/* Results tab styling */
.results-tab-button {
    position: relative;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    margin: 0.25rem;
}

.results-tab-button:hover {
    color: #374151;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.results-tab-button.active {
    color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

/* Tab content animations */
.tab-content,
.results-tab-content {
    animation: fadeInUp 0.2s ease-out;
}

.tab-content.hidden,
.results-tab-content.hidden {
    display: none;
}

/* Smooth fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Statistics cards */
.stat-card {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}

.stat-number,
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    color: #4b5563;
    margin-top: 0.25rem;
}

/* Analytics cards */
.analytics-card {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
}

/* Results table styling */
#ngrams-table tr:hover {
    background-color: #dbeafe;
}

#ngrams-table td {
    transition: all 0.15s ease;
}

/* Export buttons */
.export-btn {
    transition: all 0.2s ease;
}

.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Sample cards */
.sample-card {
    transition: all 0.2s ease;
}

.sample-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* File upload area */
.border-dashed {
    transition: all 0.2s ease;
}

/* Loading spinner animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Chart container */
#frequency-chart {
    min-height: 300px;
}

/* Responsive design improvements */
@media (max-width: 768px) {
    .stat-card {
        padding: 0.75rem;
    }

    .stat-number,
    .stat-value {
        font-size: 1.25rem;
    }

    .analytics-card {
        padding: 0.75rem;
    }

    #ngrams-table {
        font-size: 0.875rem;
    }

    #ngrams-table td {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Custom scrollbar for text areas */
textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background-color: #f3f4f6;
    border-radius: 0.25rem;
}

textarea::-webkit-scrollbar-thumb {
    background-color: #9ca3af;
    border-radius: 0.25rem;
}

textarea::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}

/* Results section animations */
#results-section {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* N-gram highlighting */
.ngram-highlight {
    background-color: #fef3c7;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    border-radius: 0.25rem;
}

/* Pagination styling */
#pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pagination button:not(:disabled):hover {
    background-color: #f3f4f6;
}

/* Alert animations */
.fixed.top-4.right-4 {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Modal animations */
.fixed.inset-0 {
    animation: fadeIn 0.2s ease-out;
}

.fixed.inset-0 > div {
    animation: scaleIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Button hover effects */
.hover\:scale-\[1\.02\]:hover {
    transform: scale(1.02);
}

/* Focus styles for accessibility */
.focus\:ring-2:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Dark mode preparation (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles would go here */
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    #results-section {
        page-break-inside: avoid;
    }

    .stat-card,
    .analytics-card {
        break-inside: avoid;
    }
}
