/* Custom styles for InsPal */

/* Color scheme variables */
:root {
    --primary-color: #4338ca;
    --primary-hover: #3730a3;
    --secondary-color: #f3f4f6;
    --accent-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --purple-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --light-purple-gradient: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

/* Navigation */
.nav-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #4338ca;
    background-color: transparent;
    border: 1px solid #4338ca;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.nav-btn.active {
    color: white;
    background-color: #4338ca;
    border-color: #4338ca;
}

.nav-btn:hover {
    background-color: #4338ca;
    color: white;
    border-color: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(67, 56, 202, 0.2);
}

/* Authentication buttons */
.auth-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.auth-btn-outline {
    color: #4338ca;
    background-color: transparent;
    border: 1px solid #4338ca;
}

.auth-btn-outline:hover {
    background-color: #4338ca;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(67, 56, 202, 0.2);
}

.auth-btn-primary {
    color: white;
    background-color: #4338ca;
    border: 1px solid #4338ca;
}

.auth-btn-primary:hover {
    background-color: #3730a3;
    border-color: #3730a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(67, 56, 202, 0.3);
}

/* Page transitions */
.page {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Upload zone */
#upload-zone {
    transition: all 0.3s ease;
}

#upload-zone:hover {
    border-color: #4338ca;
    background-color: #eef2ff;
}

#upload-zone.dragover {
    border-color: #3730a3;
    background-color: #e0e7ff;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #4338ca;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Document cards */
.document-card {
    @apply bg-white border border-gray-200 rounded-lg p-4 hover:shadow-md transition-shadow;
}

.document-card:hover {
    @apply shadow-lg;
}

/* Form elements */
textarea:focus, input:focus {
    @apply ring-2 border-transparent;
    --tw-ring-color: #4338ca;
}

/* Progress bar animation */
.progress-bar {
    transition: width 0.3s ease;
}

/* Answer display */
.prose {
    @apply text-gray-700 leading-relaxed;
}

/* Timeline styles */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #4338ca, #3730a3);
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-left: 70px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 10px;
    width: 12px;
    height: 12px;
    background: #4338ca;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #4338ca;
    z-index: 1;
}

.timeline-item:hover::before {
    background: #1d4ed8;
    box-shadow: 0 0 0 2px #1d4ed8, 0 0 0 4px rgba(29, 78, 216, 0.2);
    transform: scale(1.2);
    transition: all 0.3s ease;
}

.timeline-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    cursor: pointer;
}

.timeline-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.timeline-time {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.timeline-question {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
    line-height: 1.4;
}

.timeline-answer {
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.timeline-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-tag {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.timeline-tag.covered {
    background: #d1fae5;
    color: #065f46;
}

.timeline-tag.not-covered {
    background: #fee2e2;
    color: #991b1b;
}

.timeline-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.timeline-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: #d1d5db;
}

/* Timeline toggle buttons */
.timeline-view-toggle {
    display: flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
}

.timeline-view-toggle button {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-view-toggle button.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timeline-view-toggle button:hover:not(.active) {
    color: #374151;
}

/* Timeline date groups */
.timeline-date-group {
    margin-bottom: 40px;
}

.timeline-date-group h4 {
    position: relative;
    font-weight: 600;
    color: #374151;
    margin-bottom: 20px;
}

.timeline-date-group h4::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 30px;
    height: 2px;
    background: #4338ca;
}

.prose p {
    @apply mb-4;
}

.prose h3 {
    @apply text-lg font-semibold mb-2;
}

.prose h4 {
    @apply text-base font-medium mb-2;
}

/* Enhanced answer formatting */
.prose ul {
    @apply mb-4;
}

.prose li {
    @apply mb-2 leading-relaxed;
}

.prose strong {
    @apply font-semibold text-gray-900;
}

/* Modern coverage item styling */
.coverage-item {
    @apply transition-all duration-200 hover:shadow-md;
}

/* Help Bubble Styles */
.help-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #4338ca;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(67, 56, 202, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.help-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(67, 56, 202, 0.4);
}

.help-bubble.active {
    background: #3730a3;
}

.help-bubble img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.help-tooltip {
    position: fixed;
    background: white;
    border: 2px solid #4338ca;
    border-radius: 16px;
    padding: 16px;
    max-width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.help-tooltip.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.help-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #4338ca;
}

.help-tooltip.bottom::before {
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.help-tooltip.top::before {
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(180deg);
}

.help-tooltip.left::before {
    left: -10px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
}

.help-tooltip.right::before {
    right: -10px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

.help-tooltip-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.help-tooltip-avatar {
    width: 32px;
    height: 32px;
    margin-right: 12px;
}

.help-tooltip-title {
    font-weight: 600;
    color: #4338ca;
    margin: 0;
}

.help-tooltip-content {
    color: #374151;
    line-height: 1.5;
    font-size: 14px;
}

.help-tooltip-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.help-tooltip-btn {
    padding: 6px 12px;
    border: 1px solid #4338ca;
    background: transparent;
    color: #4338ca;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.help-tooltip-btn:hover {
    background: #4338ca;
    color: white;
}

.help-tooltip-btn.primary {
    background: #4338ca;
    color: white;
}

.help-tooltip-btn.primary:hover {
    background: #3730a3;
}

/* Contextual Help Highlights */
.help-highlight {
    position: relative;
}

.help-highlight::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #4338ca;
    border-radius: 8px;
    opacity: 0;
    animation: helpPulse 2s infinite;
    pointer-events: none;
}

@keyframes helpPulse {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}

/* Help tour overlay */
.help-tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.help-tour-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.help-tour-spotlight {
    position: absolute;
    border: 2px solid #4338ca;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
}

/* Animation for help bubble entrance */
@keyframes helpBubbleEntrance {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(90deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.help-bubble.entering {
    animation: helpBubbleEntrance 0.6s ease-out;
}

.coverage-item:hover {
    @apply transform scale-105;
}

/* Coverage status highlighting */
.coverage-status {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs font-bold transition-colors;
}

.coverage-included {
    @apply bg-green-100 text-green-800;
}

.coverage-excluded {
    @apply bg-red-100 text-red-800;
}

/* Card animations */
.answer-card {
    @apply transform transition-all duration-300;
}

.answer-card:hover {
    @apply shadow-xl;
}

/* Gradient backgrounds */
.gradient-header {
    @apply bg-gradient-to-r from-blue-600 to-blue-700;
}

/* Enhanced typography */
.prose h4 {
    @apply text-base font-semibold text-gray-900 mb-2;
}

.prose .coverage-details {
    @apply text-sm text-gray-600 space-y-1;
}

/* Responsive design */
@media (max-width: 640px) {
    .nav-btn {
        @apply px-2 py-1 text-xs;
    }
    
    .nav-btn i {
        @apply text-sm;
    }
    
    #upload-zone {
        @apply p-4;
    }
    
    #upload-zone i {
        @apply text-2xl;
    }
    
    #upload-zone p {
        @apply text-base;
    }
}

/* Loading states */
.loading {
    @apply opacity-50 pointer-events-none;
}

/* Error states */
.error {
    @apply border-red-500 bg-red-50;
}

/* Success states */
.success {
    @apply border-green-500 bg-green-50;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
