* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 12px;
    --background: #ffffff;
    --foreground: #0a0a0a;
    --muted-foreground: #71717a;
    --destructive: #ef4444;
    --destructive-foreground: #fafafa;
    --input: #e4e4e7;
    --ring: #0a0a0a;
}

/* Full Page Loader for Mirror Connection */
.mirror-connection-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.3s ease;
}

.mirror-connection-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 102, 204, 0.2);
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.loader-content p {
    font-size: 1rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #ffffff;
    color: var(--text);
    padding: 1rem;
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 1024px;
    margin: 0 auto;
    background: var(--bg);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card {
    position: relative;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
    z-index: 1;
    margin-bottom: 1.5rem;
}

/* Hide main catalog by default - only show in modal */
.main-catalog-card {
    display: none;
}

.card-header {
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-description {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.main-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.action-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.15);
    border-color: var(--primary);
}

.action-card:hover::before {
    transform: scaleX(1);
}

.action-card i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.action-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.action-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-panel {
    background: var(--card);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.control-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-title i {
    color: var(--primary);
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.toggle-row:last-child {
    margin-bottom: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.toggle-label i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.toggle-switch {
    width: 48px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

.quick-actions {
    display: grid;
    gap: 0.75rem;
}

.compact-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.compact-btn i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.compact-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateX(4px);
}

.compact-btn:hover i {
    color: white;
}

.status-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--card);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.status-badge {
    background: var(--bg);
    padding: 0.875rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.status-badge i {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.status-badge.active i {
    color: var(--success);
}

.status-badge span {
    font-size: 0.75rem;
    color: var(--secondary);
    display: block;
}

.status-badge.active span {
    color: var(--success);
}

.gallery-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.gallery-header h2 {
    font-size: 1.1rem;
    color: var(--text);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.gallery-item {
    aspect-ratio: 3/4;
    background: var(--bg);
    border-radius: 8px;
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.5rem;
    text-align: center;
}

.gallery-item i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Photo gallery specific styles */
.photo-item {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    aspect-ratio: 3/4;
}

.photo-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-info {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    flex-shrink: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
}

.photo-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.photo-item:hover .photo-actions {
    opacity: 1;
}

.photo-actions button {
    padding: 0.4rem 0.6rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.photo-actions .btn-primary {
    background: var(--primary);
    color: white;
}

.photo-actions .btn-danger {
    background: var(--destructive);
    color: var(--destructive-foreground);
}

/* ============================================
           PHOTO GALLERY MODAL - PREMIUM DESIGN
           ============================================ */

/* Photo Gallery Modal Specific Styles */
.photo-gallery-modal-content {
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    overflow: hidden;
}

.photo-gallery-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1rem 1.5rem;
    border-bottom: none;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.photo-gallery-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.photo-gallery-icon-wrapper {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.photo-gallery-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.photo-gallery-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin: 0.25rem 0 0 0;
    font-weight: 400;
}

.photo-gallery-close {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.photo-gallery-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.photo-gallery-body {
    padding: 1.5rem;
}

/* Gallery Grid Container */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
    padding: 0;
}

/* Individual Photo Card */
.gallery-photo-item {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 3px solid transparent;
}

.gallery-photo-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(59, 130, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.gallery-photo-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
    border-color: var(--primary);
}

.gallery-photo-item:hover::before {
    opacity: 1;
}

/* Photo Image */
.gallery-photo-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-photo-item:hover img {
    transform: scale(1.05);
}

/* Photo Label */
.gallery-photo-item small {
    display: block;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    background: #ffffff;
    text-align: center;
    border-top: 2px solid #f1f5f9;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.gallery-photo-item:hover small {
    background: var(--primary);
    color: white;
    border-top-color: var(--primary);
}

/* Hover Overlay Effect */
.gallery-photo-item .photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(59, 130, 246, 0.88));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 3;
    backdrop-filter: blur(4px);
}

.gallery-photo-item:hover .photo-overlay {
    opacity: 1;
}

.gallery-photo-item .photo-overlay i {
    color: #ffffff;
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.gallery-photo-item .photo-overlay::after {
    content: 'Click to Select';
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
    opacity: 0.95;
}

/* Empty State */
.gallery-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, #e0e7ff, #dbeafe);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--primary);
}

.gallery-empty-state h3 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.gallery-empty-state p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Utility Classes */
.gallery-section-header {
    margin-bottom: 1rem;
}

.gallery-section-header h6 {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.py-4 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.fa-2x {
    font-size: 2rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .photo-gallery-header {
        padding: 1rem;
    }

    .photo-gallery-header-content {
        gap: 0.75rem;
    }

    .photo-gallery-icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .photo-gallery-title {
        font-size: 1.1rem;
    }

    .photo-gallery-subtitle {
        font-size: 0.8rem;
    }

    .photo-gallery-body {
        padding: 1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .gallery-photo-item small {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .gallery-photo-item .photo-overlay i {
        font-size: 2.5rem;
    }

    .gallery-photo-item:hover {
        transform: translateY(-6px);
    }

    .photo-gallery-close {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .photo-gallery-header-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .empty-state-icon {
        width: 100px;
        height: 100px;
        font-size: 3rem;
    }
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
}

/* Photo Gallery Modal - Higher z-index to appear above other modals */
#photoGalleryModal {
    z-index: 10500;
}

#photoGalleryModal .modal-content {
    z-index: 10501;
}

.modal-content {
    position: relative;
    background-color: var(--card);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    max-width: 90rem;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    z-index: 10000;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 1rem 1.25rem;
    position: relative;
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    z-index: 10001;
    transition: all 0.3s ease;
}

.close-button:hover {
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 0.875rem;
}

.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.input,
.select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    background-color: transparent;
    font-size: 0.875rem;
}

.input:focus,
.select:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(10, 10, 10, 0.1);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.5rem;
}

.button-primary {
    background-color: var(--primary);
    color: white;
}

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

.button-outline {
    border: 1px solid var(--border);
    background-color: transparent;
    color: var(--foreground);
}

.button-outline:hover {
    background-color: var(--bg);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.photo-preview {
    aspect-ratio: 9/16;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
    max-height: 450px;
    width: 100%;
}

.photo-preview:hover {
    border-color: var(--primary);
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.photo-preview.has-photo {
    border: 2px solid var(--primary);
    background: #ffffff;
    padding: 0;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: calc(var(--radius) - 2px);
}

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.progress {
    width: 100%;
    height: 0.5rem;
    background-color: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 0.5rem;
}

/* Catalog Item Card - Premium Design */
.catalog-item.card {
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
    border: 2px solid transparent;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.5s ease-out backwards;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}

/* Staggered animation for cards */
.catalog-item.card:nth-child(1) {
    animation-delay: 0.05s;
}

.catalog-item.card:nth-child(2) {
    animation-delay: 0.1s;
}

.catalog-item.card:nth-child(3) {
    animation-delay: 0.15s;
}

.catalog-item.card:nth-child(4) {
    animation-delay: 0.2s;
}

.catalog-item.card:nth-child(5) {
    animation-delay: 0.25s;
}

.catalog-item.card:nth-child(6) {
    animation-delay: 0.3s;
}

.catalog-item.card:nth-child(7) {
    animation-delay: 0.35s;
}

.catalog-item.card:nth-child(8) {
    animation-delay: 0.4s;
}

.catalog-item.card:nth-child(9) {
    animation-delay: 0.45s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gradient border effect on hover */
.catalog-item.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), #3b82f6, var(--primary-dark));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.catalog-item.card:hover::before {
    opacity: 1;
}

/* Shimmer effect on hover */
.catalog-item.card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.catalog-item.card:hover::after {
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) rotate(45deg);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateX(100%) rotate(45deg);
        opacity: 0;
    }
}

.catalog-item.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.25);
    border-color: var(--primary);
    background: linear-gradient(to bottom, #ffffff 0%, #f0f4ff 100%);
}

/* Image container with overlay */
.catalog-item.card .image-container {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.card-img-top {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.catalog-item.card:hover .card-img-top {
    transform: scale(1.1);
}

/* Image overlay on hover */
.catalog-item.card .image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.85), rgba(59, 130, 246, 0.75));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.catalog-item.card:hover .image-overlay {
    opacity: 1;
}

.catalog-item.card .image-overlay i {
    color: white;
    font-size: 3rem;
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Card body styling */
.card-body {
    padding: 1.25rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-body h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
    min-height: 2.4em;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.catalog-item.card:hover .card-body h5 {
    color: var(--primary);
}

.card-text {
    color: var(--muted-foreground);
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price badge */
.catalog-item.card .price-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
}

.catalog-item.card:hover .price-badge {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.p-0 {
    padding: 0;
}

.pt-5 {
    padding-top: 10px !important;
}

.d-block {
    display: block !important;
}

.mt-1 {
    margin-top: 0.25rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 0.75rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-center {
    text-align: center !important;
}

h6 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

.gallery-section-header h6 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

p {
    margin: 0 0 0.5rem 0;
}

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

    .secondary-grid {
        grid-template-columns: 1fr;
    }

    .status-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid {
        grid-template-columns: 1fr;
    }

    body {
        padding: 0.5rem;
    }

    .container {
        padding: 1rem;
    }

    /* Catalog items responsive */
    .modal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .card-img-top {
        height: 200px;
    }

    .catalog-item.card .image-overlay i {
        font-size: 2.5rem;
    }

    .catalog-item.card .select-overlay button {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .modal-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .catalog-item.card {
        max-width: 100%;
    }
}