/* Global Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--background);
    line-height: 1.6;
}

/* Header */
.header-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 0;
}

.header-section h1 {
    color: white;
    font-weight: 300;
}

/* Filter Section */
.filter-section {
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.filter-btn {
    transition: all 0.3s ease;
    border-radius: 25px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.filter-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Gallery */
.gallery-section {
    min-height: 60vh;
}

.card-item {
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card-item.hidden {
    display: none;
}

.card-thumbnail {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: #f8fafc;
    transition: transform 0.3s ease;
}

.card-item:hover .card-thumbnail {
    transform: scale(1.05);
}

.card-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
    min-height: 2.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.card-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background-color: #f1f5f9;
    color: var(--text-secondary);
    border-radius: 12px;
    font-weight: 500;
}

/* Modal Styles */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem 1.5rem 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.image-container {
    position: relative;
}

.image-wrapper {
    overflow: hidden;
    border-radius: 8px;
    background: #f8fafc;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-card-image {
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.zoom-controls {
    display: flex;
    gap: 0.5rem;
}

.image-tabs {
    display: flex;
    gap: 0.5rem;
}

.image-tabs .btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.card-details {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-metadata {
    background-color: #f8fafc;
    padding: 1.25rem;
    border-radius: 8px;
}

.action-buttons .btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.social-sharing {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.share-btn {
    flex: 1;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .header-section h1 {
        font-size: 2rem;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
    
    .card-thumbnail {
        height: 250px;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .zoom-controls {
        flex-wrap: wrap;
    }
    
    .social-sharing .d-flex {
        flex-wrap: wrap;
    }
    
    .share-btn {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: calc(50% - 0.5rem);
    }
}

@media (max-width: 576px) {
    .card-thumbnail {
        height: 200px;
    }
    
    .image-wrapper {
        min-height: 300px;
    }
    
    #modal-card-image {
        max-height: 400px;
    }
}

/* Animation for card appearance */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-item {
    animation: fadeIn 0.5s ease-out;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.filter-btn:focus,
.share-btn:focus,
.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
