@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #d61f26;
    --primary-dark: #a0161c;
    --primary-light: #ef4444;
    --secondary-color: #b91c1c;
    --accent-color: #991b1b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-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;
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--gray-800);
    line-height: 1.5;
    background-color: #f5f7fa;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Card Styles */
.card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background-color: var(--gray-50);
}

.card-title {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-text {
    margin-bottom: 1rem;
    color: var(--gray-700);
}

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

/* Image Styles */
.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-thumbnail {
    padding: 0.25rem;
    background-color: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
}

.img-zoom-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    cursor: pointer;
}

.img-zoom-container img {
    transition: transform 0.3s ease;
}

.img-zoom-container:hover img {
    transform: scale(1.05);
}

.app-name {
    font-size: 1.2rem; 
    font-weight: 600;
}
.logo {
    height: 3rem;
    padding-bottom: 0.6rem;    
}

/* Form Elements */
.form-label {
    display: block;
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--gray-800);
    background-color: white;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary-light);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(214, 31, 38, 0.25);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    color: var(--gray-700);
    background-color: white;
    border-color: var(--gray-300);
}

.btn-secondary:hover {
    background-color: var(--gray-100);
    border-color: var(--gray-400);
}

/* Loading Animation */
.loading {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loading:after {
    content: '';
    display: block;
    width: 64px;
    height: 64px;
    margin: 8px;
    border-radius: 50%;
    border: 6px solid var(--primary-color);
    border-color: var(--primary-color) transparent var(--primary-color) transparent;
    animation: loading 1.2s linear infinite;
}

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

/* Other utility classes */
.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.radius-md {
    border-radius: 0.375rem;
}

.radius-lg {
    border-radius: 0.5rem;
}

.radius-xl {
    border-radius: 0.75rem;
}

/* Sidebar styles */
.sidebar {
    min-height: calc(100vh - 56px);
    transition: width 0.3s ease-in-out;
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 20;
    height: calc(100vh - 56px);
    overflow-y: auto;
    background-color: #ffffff; /* Ensure bg is white */
    border-right: 1px solid #e5e7eb; /* Add a subtle border */
}

.sidebar-expanded {
    width: 256px;
}

.sidebar-collapsed {
    width: 80px;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

#mini-generations-list {
    /* Adjust height calculation based on parent padding and sibling elements */
    height: calc(100% - 6rem); /* Example: Adjust based on actual space */
    overflow-y: auto;
}

/* Main content styles */
#main-content {
    transition: margin-left 0.3s ease;
}

#main-content.sidebar-expanded {
    margin-left: 256px;
}

#main-content.sidebar-collapsed {
    margin-left: 80px;
}

/* Mini thumbnails for collapsed view */
.mini-thumbnail {
    width: 48px; /* Slightly larger */
    height: 48px;
    object-fit: cover;
    border-radius: 50%; /* Make it circular */
    margin: 0 auto; /* Center horizontally, remove vertical margin */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    background-color: #f6f6f3; /* bg-gray-100 */
    border: 2px solid #ffffff; /* White border for separation */
    transition: transform 0.2s ease;
    display: block; /* Ensure it behaves like a block element */
}

.mini-thumbnail:hover {
    /* transform: scale(1.1); */
    box-shadow: 0 4px 8px var(--primary-light);
}

/* Style for the container holding mini thumbnails */
#mini-generations-list {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #d1d5db #f9fafb; /* Firefox */
}

#mini-generations-list::-webkit-scrollbar {
    width: 5px;
}

#mini-generations-list::-webkit-scrollbar-track {
    background: #f9fafb; /* bg-gray-50 */
}

#mini-generations-list::-webkit-scrollbar-thumb {
    background-color: #d1d5db; /* bg-gray-300 */
    border-radius: 10px;
    border: 2px solid #f9fafb; /* bg-gray-50 */
}

/* Placeholder styling */
.img-placeholder {
    background-color: rgba(243, 244, 246, 1); /* bg-gray-100 */
    border: 1px dashed rgba(209, 213, 219, 1); /* border-gray-300 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(156, 163, 175, 1); /* text-gray-400 */
    font-size: 0.875rem;
}

/* Add a subtle border to images */
img.object-cover, 
img.object-contain {
    background-color: rgba(243, 244, 246, 1); /* bg-gray-100 */
    border: 1px solid rgba(229, 231, 235, 1); /* border-gray-200 */
}

/* Loading animation for image placeholders */
.image-loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    background-color: rgba(243, 244, 246, 1); /* bg-gray-100 */
}

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

/* Ensure images cannot overflow their containers */
.image-container img,
.gallery-item img,
.fixed-height img {
    max-width: 100%;
    max-height: 100%;
}

/* Responsive image handling */
@media (max-width: 640px) {
    .container {
        padding: 5px 2px;        
    }

    #main-content.sidebar-expanded {
        margin-left: 0;
    }
    
    .sidebar-expanded {
        width: 100%;
    }
    
    #main-content.sidebar-collapsed {
        margin-left: 0;
    }
    
    .sidebar-collapsed {
        width: 0px;
    }
    .app-name {
        font-size: 1rem;
        font-weight: 400;
    }
    .logo {
        height: 1rem;
    }
    .mobile-hide {
        display: none;
    }
}

/* Input styles */
.form-input {
    @apply mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-red-500 focus:border-red-500 sm:text-sm;
}

.form-label {
    @apply block text-sm font-medium text-gray-700;
}

.btn {
    @apply px-4 py-2 rounded-md text-sm font-medium;
}

.btn-primary {
    @apply bg-red-600 text-white hover:bg-red-700;
}

.btn-secondary {
    @apply bg-gray-200 text-gray-700 hover:bg-gray-300;
}

.btn-block {
    @apply w-full flex justify-center;
}

/* Card Animation - Used across multiple pages */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-animation {
    animation: cardAppear 0.5s ease-out forwards;
}

/* Animation delay classes - Used in results and other pages */
.delay-0 { animation-delay: 0ms; }
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }
.delay-5 { animation-delay: 500ms; }
.delay-6 { animation-delay: 600ms; }
.delay-7 { animation-delay: 700ms; }
.delay-8 { animation-delay: 800ms; }
.delay-9 { animation-delay: 900ms; }
.delay-10 { animation-delay: 1000ms; }

/* Image container styles - Shared between pages */
.img-zoom-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
}

.img-zoom-container img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-zoom-container:hover img {
    transform: scale(1.05);
}

/* Badge container - Used in results and potentially other pages */
.badge-container {
    position: absolute;
    top: .5rem;
    right: .5rem;
    z-index: 30;
}

/* Card hover effects - Used across multiple components */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
} 
.filter-light-gray {
    /* This filter is an approximation and might need adjustment based on the original SVG color */
    filter: invert(85%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(1.1) contrast(1);
}
  