/* Custom styles for the application */

/* Global font settings for serif fonts */
body {
    font-family: 'Libre Baskerville', Georgia, serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
}

.card-title, .navbar-brand {
    font-family: 'Libre Baskerville', Georgia, serif;
}

.btn, .form-control, .form-select {
    font-family: 'Libre Baskerville', Georgia, serif;
}

/* Mobile-first responsive design */
html {
    font-size: 16px;
}

/* Scale font size based on viewport width for mobile */
@media (max-width: 576px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .tool-card .card-body {
        padding: 1rem;
    }
}

/* Make clickable elements in the cluster chart show the pointer cursor */
#clusterChart {
    cursor: pointer;
}

/* Enhance the loading animation */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Improve table display for crawled pages */
.table-responsive {
    max-height: 500px;
    overflow-y: auto;
}

/* Style badge elements for keywords */
.badge {
    font-size: 0.9em;
    padding: 0.5em 0.7em;
}

/* Tool cards styling */
.tool-card {
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--bs-primary);
}

.tool-card .card-body {
    padding: 1.5rem;
}

.tool-card i {
    transition: transform 0.3s ease;
}

.tool-card:hover i {
    transform: scale(1.1);
}

.tool-card .card-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tool-card .card-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Custom styling for other cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Custom styles for the accordion */
.accordion-button:not(.collapsed) {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

/* Custom styling for the export button */
.btn-success {
    padding: 0.375rem 1rem;
}

/* Add animation to the progress bar */
@keyframes progress-bar-stripes {
    0% { background-position-x: 1rem; }
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

/* Make sure charts have enough height */
canvas {
    min-height: 250px;
}

/* Back button styling */
.back-button {
    transition: all 0.2s ease;
}

.back-button:hover {
    background-color: var(--bs-secondary);
    color: white;
}

/* Form styling */
.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Tool sections */
.card-header {
    border-bottom: none;
    padding: 1rem 1.25rem;
}

/* Helper classes */
.opacity-75 {
    opacity: 0.75;
}

/* Progress animation */
.progress {
    height: 0.6rem;
    border-radius: 0.25rem;
}

/* Footer styling */
footer {
    margin-top: 4rem !important;
}

/* Navbar enhancements */
.navbar-brand {
    font-weight: 600;
    padding: 0.5rem 0;
}

/* Custom wrapper for results page */
.results-wrapper {
    margin-top: 2rem;
}

/* Enhanced Mobile Styles */
@media (max-width: 768px) {
    .row-cols-md-2 > .col {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .tool-card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .navbar-brand img {
        height: 20px !important;
    }
    
    .form-control, .form-select, .btn {
        font-size: 1rem;
        padding: 0.375rem 0.75rem;
    }
    
    .accordion-button {
        padding: 0.75rem 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    /* Make tool cards more touch-friendly */
    .tool-card .card-body {
        padding: 1.25rem;
    }
    
    .tool-card:hover {
        transform: translateY(-3px);
    }
    
    /* Improve form elements spacing */
    .mb-4 {
        margin-bottom: 1.25rem !important;
    }
    
    /* Better scrolling for mobile */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

/* Touch-friendly form controls */
.form-control, .form-select, .btn {
    border-radius: 0.375rem;
}

/* Smooth scrolling for entire page */
html {
    scroll-behavior: smooth;
}

/* Add skeleton loading animation */
@keyframes skeleton-loading {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-loading {
    background: linear-gradient(90deg, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}
