/* Custom styles for NonZero Archive Explorer */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navigation customization */
.navbar-dark.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Card styling */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.3s ease-in-out;
}

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

/* Query result styling */
.query-result {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.query-result:hover {
    background-color: var(--light-bg);
}

/* Context chunk styling */
.context-chunk {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.context-chunk .metadata {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

/* YouTube link styling */
a.youtube-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

a.youtube-link:hover {
    text-decoration: underline;
}

/* Form styling */
.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Search box styling */
.search-container {
    background-color: var(--light-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

/* Parameter sidebar */
.parameter-sidebar {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    position: sticky;
    top: 1rem;
}

/* History item styling */
.history-item {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item .query-text {
    font-weight: 500;
    color: var(--dark-text);
}

.history-item .timestamp {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Favorite button */
.btn-favorite {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
}

.btn-favorite.active {
    color: #ffc107;
}

/* Loading spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Response container */
.response-container {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

/* Markdown content styling */
.response-text {
    line-height: 1.6;
}

.response-text p {
    margin-bottom: 1rem;
}

.response-text p:last-child {
    margin-bottom: 0;
}

.response-text h1, .response-text h2, .response-text h3, 
.response-text h4, .response-text h5, .response-text h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.response-text h1:first-child, .response-text h2:first-child, 
.response-text h3:first-child, .response-text h4:first-child, 
.response-text h5:first-child, .response-text h6:first-child {
    margin-top: 0;
}

.response-text ul, .response-text ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.response-text li {
    margin-bottom: 0.25rem;
}

.response-text blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #6c757d;
}

.response-text code {
    background-color: #f8f9fa;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    color: #e83e8c;
}

.response-text pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.response-text pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

.response-text a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.response-text a:hover {
    text-decoration: underline;
}

/* YouTube links get special styling */
.response-text a[href*="youtube.com"] {
    color: #ff0000;
    font-weight: 600;
}

.response-text a[href*="youtube.com"]:before {
    content: "🎥 ";
}

.response-text hr {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid #dee2e6;
}

/* App cards on homepage */
.app-card {
    height: 100%;
    transition: transform 0.2s ease-in-out;
}

.app-card:hover {
    transform: translateY(-5px);
}

.app-card .card-body {
    display: flex;
    flex-direction: column;
}

.app-card .card-text {
    flex-grow: 1;
}

/* Preference settings */
.preference-group {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

/* Progress indicator styles */
.progress-container {
    margin: 1.5rem 0;
}

.progress-steps {
    margin-top: 1rem;
}

.progress-step {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.progress-step:last-child {
    border-bottom: none;
}

.progress-step .step-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
    transition: all 0.3s ease;
}

.progress-step.active .step-icon {
    background-color: var(--secondary-color);
    color: white;
}

.progress-step.complete .step-icon {
    background-color: var(--success-color);
    color: white;
}

.progress-step.error .step-icon {
    background-color: var(--danger-color);
    color: white;
}

.progress-step .step-text {
    flex-grow: 1;
    font-weight: 500;
    color: #495057;
}

.progress-step.active .step-text {
    color: var(--secondary-color);
}

.progress-step.complete .step-text {
    color: var(--success-color);
}

.progress-step .step-status {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spinning animation */
.spin {
    animation: spin 2s linear infinite;
}

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

/* Enhanced spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Pulse animation for active steps */
.progress-step.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { background-color: transparent; }
    50% { background-color: rgba(52, 152, 219, 0.1); }
    100% { background-color: transparent; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .parameter-sidebar {
        position: relative;
        margin-bottom: 1rem;
    }
    
    .search-container {
        padding: 1rem;
    }
    
    .progress-step {
        padding: 0.5rem 0;
    }
    
    .progress-step .step-icon {
        width: 1.5rem;
        height: 1.5rem;
        margin-right: 0.75rem;
        font-size: 0.75rem;
    }
    
    .progress-step .step-text {
        font-size: 0.875rem;
    }
}

/* Follow-up Query Section */
.follow-up-section {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-top: 2rem;
}

.follow-up-section h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.follow-up-section .input-group {
    margin-top: 1rem;
}

.followup-response-item {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#followup-responses .card {
    border-left: 3px solid var(--primary-color);
}

#followup-responses .response-text {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Responsive follow-up section */
@media (max-width: 768px) {
    .follow-up-section {
        padding: 1rem;
    }
}