/* Custom styles for SplitSmart */

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

/* Drop zone border style */
#dropZone {
    border-width: 3px;
}

/* Thumbnail hover effects */
.page-thumbnail {
    animation: fadeIn 0.3s ease-in-out;
    transform-origin: center;
}

.page-thumbnail:hover {
    transform: translateY(-4px);
}

.page-thumbnail canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading spinner animation enhancement */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transitions for all interactive elements */
button, .page-thumbnail, #dropZone {
    transition: all 0.3s ease;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

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

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

/* Ensure canvas quality */
canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .page-thumbnail {
        font-size: 0.875rem;
    }
}

/* File info slide-in animation */
#fileInfo {
    animation: slideDown 0.3s ease-out;
}

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

/* Viewer section fade-in */
#viewerSection {
    animation: fadeInSection 0.4s ease-out;
}

@keyframes fadeInSection {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page thumbnail selection state (for future features) */
.page-thumbnail.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* ============================================
   AI Inspector Styles
   ============================================ */

/* AI Inspector panel fade-in */
#aiInspectorPanel {
    animation: fadeInSection 0.5s ease-out;
}

/* Split badge */
.split-badge {
    animation: badgePulse 0.5s ease-out;
    z-index: 10;
}

@keyframes badgePulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Split thumbnail highlight */
.page-thumbnail.border-green-500 {
    border-width: 3px;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.page-thumbnail.border-purple-500 {
    border-width: 3px;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

/* Analysis progress animations */
#analysisProgress {
    animation: slideDown 0.3s ease-out;
}

/* Split point cards */
#splitPointsList > div {
    animation: slideInFromLeft 0.3s ease-out;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Disabled button state */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* API key inputs focus */
input[type="password"]:focus {
    outline: none;
}

/* Confidence badge colors */
.confidence-high {
    background-color: #dcfce7;
    color: #166534;
}

.confidence-medium {
    background-color: #fef3c7;
    color: #92400e;
}

.confidence-low {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Progress indicator animations */
#analysisProgress .animate-spin {
    animation: spin 1s linear infinite;
}

/* Results section fade-in */
#analysisResults {
    animation: fadeInSection 0.4s ease-out;
}

/* Hover effects for split cards */
#splitPointsList > div:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments for AI Inspector */
@media (max-width: 768px) {
    #aiInspectorPanel {
        padding: 1rem;
    }

    .split-badge {
        font-size: 0.6rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Download modal animations */
#downloadModal {
    animation: fadeIn 0.2s ease-out;
}

#downloadModal > div {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom split banner */
#customSplitBanner {
    animation: slideDownBanner 0.3s ease-out;
}

@keyframes slideDownBanner {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Cursor pointer for clickable thumbnails */
.page-thumbnail {
    cursor: pointer;
    user-select: none;
}

/* Active click feedback */
.page-thumbnail:active {
    transform: translateY(-2px) scale(0.98);
}
