/* CatalogHive Portal - Custom Styles */

/* 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;
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

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

/* Custom focus styles */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* File type icons */
.file-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 18px;
    color: white;
    margin-right: 12px;
}

.file-icon.pdf { background-color: #dc2626; }
.file-icon.doc { background-color: #2563eb; }
.file-icon.xls { background-color: #059669; }
.file-icon.img { background-color: #7c3aed; }
.file-icon.zip { background-color: #d97706; }

/* Brand logo placeholders */
.brand-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Search suggestions */
.search-suggestions {
    max-height: 300px;
    overflow-y: auto;
}

.search-suggestion-item:hover {
    background-color: #f8fafc;
}

/* File grid enhancements */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .file-grid {
        grid-template-columns: 1fr;
    }
}

/* Brand grid */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

/* Mobile menu */
.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.open {
    transform: translateX(0);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    .print-break {
        page-break-before: always;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-primary-600 {
        background-color: #1e40af !important;
    }

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

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles will be added here */
}

/* Sticky Footer Layout */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

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

.backdrop-blur {
    backdrop-filter: blur(8px);
}

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* File upload dropzone */
.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.dropzone.drag-over {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.dropzone.drag-active {
    border-color: #1d4ed8;
    background-color: #dbeafe;
}

/* Progress bars */
.progress-bar {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    height: 4px;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Notification styles */
.notification {
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.notification.show {
    transform: translateX(0);
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge.success {
    background-color: #dcfce7;
    color: #166534;
}

.badge.warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge.error {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge.info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* ===== PROMOTIONS STYLES ===== */

/* Promotion cards */
.promotion-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
}

.promotion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.promotion-card img {
    transition: transform 0.3s ease;
}

.promotion-card:hover img {
    transform: scale(1.05);
}

/* Line clamp utility for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Aspect ratio utilities for images */
.aspect-w-16 {
    position: relative;
    width: 100%;
}

.aspect-w-16::before {
    content: '';
    display: block;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.aspect-w-16 > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aspect-h-9 {
    /* This class works with aspect-w-16 */
}

/* Promotion management styles */
.promotion-management-card {
    transition: all 0.2s ease;
}

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

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-inactive {
    background-color: #fef2f2;
    color: #991b1b;
}

/* Promotion upload form enhancements */
.promotion-upload-form {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.promotion-upload-form:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* File type preview icons */
.file-preview-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.file-preview-icon.pdf {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.file-preview-icon.image {
    background: linear-gradient(135deg, #059669, #10b981);
}

/* Responsive promotion grid */
@media (max-width: 768px) {
    .promotion-card {
        margin-bottom: 1rem;
    }

    .aspect-w-16::before {
        padding-bottom: 50%; /* Adjust aspect ratio for mobile */
    }
}

/* Promotion form validation styles */
.form-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-success {
    color: #059669;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Loading states for promotions */
.promotion-loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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