/* Common styles shared across all pages */

/* Root variables for consistent theming */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* Dark mode variables */
.dark {
    --bg-primary: var(--gray-900);
    --bg-secondary: var(--gray-800);
    --text-primary: var(--gray-100);
    --text-secondary: var(--gray-300);
    --border-color: var(--gray-700);
}

/* Light mode variables */
:root:not(.dark) {
    --bg-primary: white;
    --bg-secondary: var(--gray-50);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --border-color: var(--gray-200);
}

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Common component styles */

/* Navigation styles */
.nav-link {
    @apply px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200;
}

.nav-link:hover {
    @apply text-blue-600 dark:text-blue-400;
}

.nav-link.active {
    @apply bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300;
}

/* Button styles */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 200ms;
    outline: none;
}

.btn:focus {
    ring: 2px;
    ring-offset: 2px;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-primary:focus {
    ring-color: #3b82f6;
}

.btn-secondary {
    background-color: #8b5cf6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7c3aed;
}

.btn-secondary:focus {
    ring-color: #a78bfa;
}

/* Dark mode: improve secondary button visibility */
.dark .btn-secondary {
    background-color: #7c3aed;
}

.dark .btn-secondary:hover {
    background-color: #6d28d9;
}

.btn-success {
    background-color: #059669;
    color: white;
}

.btn-success:hover {
    background-color: #047857;
}

.btn-success:focus {
    ring-color: #10b981;
}

.btn-warning {
    background-color: #d97706;
    color: white;
}

.btn-warning:hover {
    background-color: #b45309;
}

.btn-warning:focus {
    ring-color: #f59e0b;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-danger:focus {
    ring-color: #ef4444;
}

/* Button link style (text-only buttons) */
.btn-link {
    background: none !important;
    border: none;
    padding: 0;
    color: #2563eb; /* blue-600 */
    cursor: pointer;
    transition: color 200ms;
    display: inline-flex;
    align-items: center;
}

.btn-link:hover {
    color: #1d4ed8; /* blue-700 */
    background: none !important;
}

.btn-link:focus {
    outline: none;
    background: none !important;
}

.dark .btn-link {
    color: #60a5fa; /* blue-400 */
    background: none !important;
}

.dark .btn-link:hover {
    color: #93c5fd; /* blue-300 */
    background: none !important;
}

.dark .btn-link:focus {
    background: none !important;
}

/* Button link danger style (delete buttons) */
.btn-link-danger {
    background: none !important;
    border: none;
    padding: 0;
    color: #dc2626; /* red-600 */
    cursor: pointer;
    transition: color 200ms;
    display: inline-flex;
    align-items: center;
}

.btn-link-danger:hover {
    color: #b91c1c; /* red-700 */
    background: none !important;
}

.btn-link-danger:focus {
    outline: none;
    background: none !important;
}

.dark .btn-link-danger {
    color: #f87171; /* red-400 */
    background: none !important;
}

.dark .btn-link-danger:hover {
    color: #fca5a5; /* red-300 */
    background: none !important;
}

.dark .btn-link-danger:focus {
    background: none !important;
}

.btn-outline {
    border: 2px solid;
    background-color: transparent;
}

.btn-outline:hover {
    background-color: #f9fafb;
}

.dark .btn-outline:hover {
    background-color: #1f2937;
}

.btn-outline.btn-primary {
    border-color: #2563eb;
    color: #2563eb;
}

.btn-outline.btn-primary:hover {
    background-color: #eff6ff;
}

.dark .btn-outline.btn-primary:hover {
    background-color: rgba(37, 99, 235, 0.2);
}

/* Form styles */
.form-input {
    @apply block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm
           bg-white dark:bg-gray-800 text-gray-900 dark:text-white
           focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500
           transition-colors duration-200;
}

.search-input {
    @apply block w-full pl-11 pr-4 py-3 border border-gray-300 dark:border-gray-600 rounded-lg shadow-sm
           bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-300
           focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent
           transition-all duration-200 text-base;
}

.search-icon {
    @apply absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 dark:text-gray-300 pointer-events-none;
}

.form-label {
    @apply block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1;
}

.form-error {
    @apply text-red-600 dark:text-red-400 text-sm mt-1;
}

/* Card styles */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.dark .card {
    background-color: #1f2937;
    border-color: #374151;
}

.card-header {
    padding-left: 1.5rem;  /* 24px */
    padding-right: 1.5rem; /* 24px */
    padding-top: 1rem;     /* 16px */
    padding-bottom: 1rem;  /* 16px */
    border-bottom: 1px solid #e5e7eb;
}

.dark .card-header {
    border-bottom-color: #374151;
}

.card-body {
    padding-left: 1.5rem;  /* 24px */
    padding-right: 1.5rem; /* 24px */
    padding-top: 1.5rem;   /* 24px */
    padding-bottom: 1.5rem; /* 24px */
}

/* Headers inside card-body - using regular CSS for better compatibility */
.card-body > h2:first-child,
.card-body > h3:first-child,
.card-body > div:first-child > h2:first-child,
.card-body > div:first-child > h3:first-child {
    margin-top: 0;
}

.card-body h2,
.card-body h3 {
    margin-bottom: 1rem; /* 16px */
}

.card-footer {
    padding-left: 1.5rem;  /* 24px */
    padding-right: 1.5rem; /* 24px */
    padding-top: 1rem;     /* 16px */
    padding-bottom: 1rem;  /* 16px */
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.dark .card-footer {
    border-top-color: #374151;
    background-color: rgba(55, 65, 81, 0.5);
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 28rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.dark .modal-content {
    background-color: #1f2937; /* gray-800 */
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb; /* gray-200 */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dark .modal-header {
    border-bottom-color: #374151; /* gray-700 */
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb; /* gray-200 */
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.dark .modal-footer {
    border-top-color: #374151; /* gray-700 */
}

/* Modal close button */
.modal-close-btn {
    color: #9ca3af; /* gray-400 */
    background-color: transparent !important;
    background: none !important;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 200ms;
}

.modal-close-btn:hover {
    color: #4b5563; /* gray-600 */
    background-color: transparent !important;
    background: none !important;
}

.modal-close-btn:focus {
    outline: none;
    background-color: transparent !important;
    background: none !important;
}

.dark .modal-close-btn {
    color: #d1d5db; /* gray-300 */
    background-color: transparent !important;
    background: none !important;
}

.dark .modal-close-btn:hover {
    color: #ffffff; /* white */
    background-color: transparent !important;
    background: none !important;
}

.dark .modal-close-btn:focus {
    background-color: transparent !important;
    background: none !important;
}

/* Loading spinner */
.spinner {
    @apply animate-spin h-5 w-5 border-2 border-blue-600 border-t-transparent rounded-full;
}

.spinner-lg {
    @apply h-8 w-8;
}

.spinner-sm {
    @apply h-4 w-4;
}

/* Notification styles */
.notification {
    @apply fixed top-4 right-4 z-50 px-4 py-3 rounded-lg shadow-lg transition-all duration-300 transform;
}

.notification.success {
    @apply bg-green-500 text-white;
}

.notification.error {
    @apply bg-red-500 text-white;
}

.notification.warning {
    @apply bg-yellow-500 text-white;
}

.notification.info {
    @apply bg-blue-500 text-white;
}

/* Tooltip styles */
.tooltip {
    @apply absolute z-10 px-2 py-1 text-xs text-white bg-gray-900 rounded shadow-lg opacity-0 pointer-events-none transition-opacity duration-200;
}

.tooltip.show {
    @apply opacity-100;
}

/* Image styles */
.image-thumbnail {
    @apply w-full h-full object-cover rounded-lg transition-transform duration-200 hover:scale-105;
}

.image-placeholder {
    @apply w-full h-full bg-gray-100 dark:bg-gray-700 rounded-lg flex items-center justify-center text-gray-400 dark:text-gray-500;
}

/* Grid styles */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.grid-auto-fill {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* Fix for aspect-square in grid - ensure proper dimensions for placeholders */
/* Override Tailwind's aspect-square to use padding-bottom trick for reliable dimensions */
.grid .aspect-square {
    position: relative !important;
    display: block !important; /* Ensure visibility for Playwright */
    width: 100% !important;
    padding-bottom: 100% !important; /* Creates 1:1 aspect ratio */
    height: 0 !important; /* Required for padding-bottom trick */
    overflow: hidden !important; /* Clip content to container */
    contain: layout !important; /* Performance: isolate layout */
}

/* Position only images to fill the container created by padding-bottom */
/* Overlays and badges will be positioned normally */
.grid .aspect-square > img {
    position: absolute !important;
    display: block !important; /* Ensure visibility for Playwright */
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Other children (overlays, badges) are positioned absolutely but don't fill */
.grid .aspect-square > div {
    position: absolute !important;
}

/* Lightbox styles */
.lightbox-overlay {
    @apply fixed inset-0 bg-black bg-opacity-90 z-50 flex items-center justify-center p-4;
}

.lightbox-content {
    @apply max-w-5xl max-h-full w-full h-full flex items-center justify-center relative;
}

.lightbox-image {
    @apply max-w-full max-h-[80vh] object-contain;
}

.lightbox-video {
    @apply max-w-full max-h-[80vh];
}

.lightbox-controls {
    @apply absolute top-4 right-4 flex space-x-3 z-10;
}

.lightbox-nav {
    @apply absolute top-1/2 transform -translate-y-1/2 text-white hover:text-gray-300 text-3xl p-3 rounded-full bg-black bg-opacity-20 hover:bg-opacity-40 transition z-10;
}

.lightbox-nav.prev {
    @apply left-4;
}

.lightbox-nav.next {
    @apply right-4;
}

.lightbox-info {
    @apply absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black to-transparent text-white p-6;
}

/* Face detection styles */
.face-box {
    @apply absolute border-2 border-blue-500 bg-blue-500 bg-opacity-20 cursor-pointer transition-all duration-200;
}

.face-box:hover {
    @apply bg-opacity-30 border-blue-400;
}

.face-box.assigned {
    @apply border-green-500 bg-green-500;
}

.face-box.unassigned {
    @apply border-yellow-500 bg-yellow-500;
}

.face-box.suggested {
    @apply border-purple-500 bg-purple-500 border-dashed;
}

/* Drag and drop styles */
.drag-over {
    @apply bg-blue-50 dark:bg-blue-900/20 border-2 border-dashed border-blue-500;
}

.dragging {
    @apply opacity-50 transform scale-95;
}

/* Confidence indicators */
.confidence-high { 
    @apply border-l-4 border-green-500; 
}

.confidence-medium { 
    @apply border-l-4 border-yellow-500; 
}

.confidence-low { 
    @apply border-l-4 border-red-500; 
}

/* Z-index utilities */
:root {
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 9999;
    --z-lightbox: 10000;
}

.z-modal-backdrop {
    z-index: var(--z-modal-backdrop);
}

.z-modal {
    z-index: var(--z-modal);
}

.z-lightbox {
    z-index: var(--z-lightbox);
}

.z-toast {
    z-index: var(--z-toast);
}

/* Video/Media sizing utilities */
.min-h-media {
    min-height: 200px;
}

/* Dynamic background utilities for face detection */
.face-bg-assigned {
    background-color: rgba(34, 197, 94, 0.1);
}

.face-bg-unassigned {
    background-color: rgba(59, 130, 246, 0.1);
}

/* Face detection box positioning - used with :style for dynamic positioning */
.face-detection-box {
    position: absolute;
    border: 2px solid;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* On touch devices without hover, don't block touch events */
@media (hover: none) {
    .face-detection-box {
        pointer-events: none;
    }
}

/* On devices with hover capability, allow pointer events for hover effects */
@media (hover: hover) {
    .face-detection-box {
        pointer-events: auto;
    }
}

.face-detection-box.assigned {
    border-color: #22c55e;
    background-color: rgba(34, 197, 94, 0.1);
}

.face-detection-box.unassigned {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
}

.face-detection-box:hover {
    background-color: rgba(59, 130, 246, 0.3);
}

.face-detection-box.assigned:hover {
    background-color: rgba(34, 197, 94, 0.3);
}

/* Bounding boxes in grid view (smaller, no interaction) */
.face-detection-box-grid {
    position: absolute;
    border: 2px solid #3b82f6;  /* blue by default */
    pointer-events: none;
    z-index: 10;
    transition: all 0.2s ease;
}

.face-detection-box-grid.assigned {
    border-color: #22c55e;  /* green for manual assignments */
}

.face-detection-box-grid.unassigned {
    border-color: #3b82f6;  /* blue for unassigned faces */
}

.face-detection-box-grid.match-auto-high {
    border-color: #22c55e;  /* green - high confidence */
}

.face-detection-box-grid.match-auto-medium {
    border-color: #eab308;  /* yellow - medium confidence */
}

.face-detection-box-grid.match-needs-review {
    border-color: #f97316;  /* orange - needs review */
}

/* Match method specific colors (lightbox) */
.face-detection-box.match-auto-high {
    border-color: #22c55e;  /* green - high confidence */
    background-color: rgba(34, 197, 94, 0.15);
}

.face-detection-box.match-auto-medium {
    border-color: #eab308;  /* yellow - medium confidence */
    background-color: rgba(234, 179, 8, 0.15);
}

.face-detection-box.match-needs-review {
    border-color: #f97316;  /* orange - needs review */
    background-color: rgba(249, 115, 22, 0.15);
}

.face-detection-box.match-auto-high:hover {
    background-color: rgba(34, 197, 94, 0.3);
}

.face-detection-box.match-auto-medium:hover {
    background-color: rgba(234, 179, 8, 0.3);
}

.face-detection-box.match-needs-review:hover {
    background-color: rgba(249, 115, 22, 0.3);
}

/* Selected bounding box (for actions) - thicker dashed border, keep original colors */
.face-detection-box.selected {
    border-width: 5px;
    border-style: dashed;
    box-shadow: 0 0 20px 4px rgba(59, 130, 246, 0.8);
    z-index: 20;
}

.face-detection-box.selected.assigned {
    box-shadow: 0 0 20px 4px rgba(34, 197, 94, 0.8);
}

.face-detection-box.selected.match-auto-high {
    box-shadow: 0 0 20px 4px rgba(34, 197, 94, 0.8);
}

.face-detection-box.selected.match-auto-medium {
    box-shadow: 0 0 20px 4px rgba(234, 179, 8, 0.8);
}

.face-detection-box.selected.match-needs-review {
    box-shadow: 0 0 20px 4px rgba(249, 115, 22, 0.8);
}

/* Modal adaptive background */
.modal-adaptive-bg {
    background-color: white;
}

.dark .modal-adaptive-bg {
    background-color: rgb(31, 41, 55);
}

/* Status message colors */
.text-error {
    color: red;
}

.text-warning {
    color: orange;
}

.text-success {
    color: green;
}

.text-info {
    color: blue;
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.scrollbar-thin {
    scrollbar-width: thin;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 4px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 2px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Dark mode scrollbar */
.dark .scrollbar-thin::-webkit-scrollbar-track {
    background: var(--gray-800);
}

.dark .scrollbar-thin::-webkit-scrollbar-thumb {
    background: var(--gray-600);
}

.dark .scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Hide content until Alpine.js loads */
[x-cloak] {
    display: none !important;
}

/* Smooth transitions for all interactive elements */
a, button, input, textarea, select {
    transition: all 0.2s ease-in-out;
}

/* Focus styles for accessibility */
.focus-ring {
    @apply focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800;
}

/* Animation utilities */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-up {
    from { 
        opacity: 0;
        transform: translateY(1rem);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-down {
    from { 
        opacity: 0;
        transform: translateY(-1rem);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

.animate-slide-down {
    animation: slide-down 0.3s ease-out;
}

/* Page-specific styles previously inline */

/* Custom button colors */
.bg-primary {
    background-color: #3b82f6 !important;
}

.bg-secondary {
    background-color: #8b5cf6 !important;
}

.hover\:bg-blue-600:hover {
    background-color: #2563eb !important;
}

.hover\:bg-purple-600:hover {
    background-color: #7c3aed !important;
}

/* Dark mode text overrides */
.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6 {
    color: #f9fafb !important;
}

.dark .text-gray-900 {
    color: #f9fafb !important;
}

.dark .text-gray-800 {
    color: #e5e7eb !important;
}

.dark .text-gray-700 {
    color: #d1d5db !important;
}

.dark .text-gray-600 {
    color: #d1d5db !important;
}

.dark .text-gray-500 {
    color: #9ca3af !important;
}

.dark .text-gray-400 {
    color: #9ca3af !important;
}

.dark .text-gray-300 {
    color: #d1d5db !important;
}

.dark .text-gray-200 {
    color: #e5e7eb !important;
}

.dark .text-gray-100 {
    color: #f3f4f6 !important;
}

/* Dark mode background overrides */
.dark .bg-white {
    background-color: #1f2937 !important;
}

.dark .bg-gray-50 {
    background-color: #111827 !important;
}

.dark .bg-gray-100 {
    background-color: #374151 !important;
}

/* Dark mode border overrides */
.dark .border-gray-200 {
    border-color: #374151 !important;
}

.dark .border-gray-300 {
    border-color: #4b5563 !important;
}

/* Dark mode hover states */
.dark .hover\:text-gray-900:hover {
    color: #f9fafb !important;
}

.dark .hover\:bg-gray-50:hover {
    background-color: #374151 !important;
}

.dark .hover\:bg-gray-100:hover {
    background-color: #4b5563 !important;
}

.dark .hover\:bg-blue-50:hover {
    background-color: #1e3a8a !important;
}

/* Cards and containers in dark mode */
.dark .shadow-sm, .dark .shadow, .dark .shadow-md, .dark .shadow-lg {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.16) !important;
}

/* Buttons in dark mode */
.dark button:not(.bg-blue-600):not(.bg-green-600):not(.bg-red-600):not(.bg-purple-600):not(.modal-close-btn):not(.btn-link):not(.btn-link-danger) {
    background-color: #374151 !important;
    color: #f9fafb !important;
}

/* Forms in dark mode */
.dark input, .dark textarea, .dark select {
    background-color: #374151 !important;
    color: #f9fafb !important;
    border-color: #4b5563 !important;
}

/* Collection drag & drop styles */
.being-dragged {
    opacity: 0.5;
    transform: rotate(2deg) scale(1.02);
}

.drag-over-collection {
    border-color: #3b82f6 !important;
    background-color: rgba(59, 130, 246, 0.05) !important;
    transform: scale(1.02);
}

.dark .drag-over-collection {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

/* Drag & Drop zones - Override dark mode correctly */
.bg-gray-50 {
    background-color: #f9fafb !important;
}

.border-gray-300 {
    border-color: #d1d5db !important;
}

.hover\:bg-blue-50:hover {
    background-color: #eff6ff !important;
}

/* Lazy Loading Styles */
.lazy-loading {
    opacity: 1; /* Keep images visible even during loading to show placeholders */
    transition: opacity 0.3s ease;
}

.lazy-loaded {
    opacity: 1;
}

/* Image overlay styles */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-container:hover .image-overlay {
    opacity: 1;
}

/* Selection mode styles */
.selection-checkbox {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: white;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dark .selection-checkbox {
    background-color: #1f2937;
    border-color: #4b5563;
}

.selection-checkbox.checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
    transform: scale(1.1);
}

.media-selected {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.75);
    filter: brightness(0.9);
}

.selection-mode {
    cursor: pointer;
    user-select: none;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* New Content Indicator Badge */
.badge-new {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
    background-color: #fbbf24; /* yellow-400 */
    color: #111827; /* gray-900 */
    font-weight: 700;
    font-size: 0.75rem; /* text-xs */
    line-height: 1rem;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px; /* rounded-full */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    display: flex;
    align-items: center;
    gap: 0.25rem; /* space-x-1 */
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.badge-new i {
    color: #ca8a04; /* yellow-600 */
}

.dark .badge-new {
    background-color: #eab308; /* yellow-500 */
    color: #111827; /* gray-900 */
}

.dark .badge-new i {
    color: #a16207; /* yellow-700 */
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* ============================================ */
/* Drag and Drop Professional Effects */
/* ============================================ */

/* Item being dragged - tilted and semi-transparent */
.dragging,
.being-dragged {
    opacity: 0.6;
    transform: rotate(3deg) scale(1.05);
    transition: transform 0.2s ease, opacity 0.2s ease;
    cursor: grabbing !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

/* Drop target - dashed border with highlight */
.drag-over {
    border: 2px dashed #3b82f6 !important;
    background-color: rgba(59, 130, 246, 0.05) !important;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.dark .drag-over {
    background-color: rgba(59, 130, 246, 0.1) !important;
    border-color: #60a5fa !important;
}

/* Collection/Album/Section cards in drag mode */
[draggable="true"] {
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[draggable="true"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark [draggable="true"]:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Active dragging state */
[draggable="true"]:active {
    cursor: grabbing;
}

/* Drop zone placeholder */
.drop-placeholder {
    border: 2px dashed #3b82f6;
    background: repeating-linear-gradient(
        45deg,
        rgba(59, 130, 246, 0.05),
        rgba(59, 130, 246, 0.05) 10px,
        rgba(59, 130, 246, 0.1) 10px,
        rgba(59, 130, 246, 0.1) 20px
    );
    border-radius: 0.5rem;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dark .drop-placeholder {
    border-color: #60a5fa;
    background: repeating-linear-gradient(
        45deg,
        rgba(59, 130, 246, 0.1),
        rgba(59, 130, 246, 0.1) 10px,
        rgba(59, 130, 246, 0.15) 10px,
        rgba(59, 130, 246, 0.15) 20px
    );
    color: #60a5fa;
}

/* Visual feedback when dragging over valid drop zone */
.drag-over-valid {
    background-color: rgba(16, 185, 129, 0.1) !important;
    border-color: #10b981 !important;
}

.dark .drag-over-valid {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: #34d399 !important;
}

/* Animation for drag start */
@keyframes drag-start {
    0% {
        transform: scale(1) rotate(0deg);
    }
    100% {
        transform: scale(1.05) rotate(3deg);
    }
}

/* Animation for drop */
@keyframes drop-animation {
    0% {
        transform: scale(1.05) rotate(3deg);
        opacity: 0.6;
    }
    50% {
        transform: scale(0.95) rotate(0deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Smooth transition back after drag ends */
.drag-end-animation {
    animation: drop-animation 0.3s ease;
}

/* Prevent text selection during drag */
.dragging *,
.being-dragged * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Media items specific drag styles */
.media-card.dragging {
    transform: rotate(5deg) scale(1.1);
}

.media-card.drag-over {
    border-width: 3px;
}

/* Section/Album cards specific styles */
.collection-card.dragging,
.album-card.dragging,
.section-card.dragging {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.dark .collection-card.dragging,
.dark .album-card.dragging,
.dark .section-card.dragging {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
