/* gravur-styles.css */

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f8f6f2;
    color: #333;
}

/* Header */
.header {
    background: linear-gradient(135deg, #f4ede3 0%, #e8ddd0 100%);
    padding: 40px 0;
    text-align: center;
    border-bottom: 3px solid #d4c4a8;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 300;
    color: #6b5b4d;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    color: #8a7968;
    font-style: italic;
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 24px;
    margin: 24px auto 6px auto;
    max-width: 1400px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 220px;
    flex: 1;
}

.filter-group label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #4a4a4a;
}

.filter-group select {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #6b5b4d;
    box-shadow: 0 0 0 3px rgba(107, 91, 77, 0.1);
}

.filter-group select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa;
}

.filter-actions {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    padding-top: 34px;
}

.clear-filters {
    background: #5a4a3d;
    color: white;
    border: none;
    padding: 12px 14px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.clear-filters:hover {
    background: #5a4a3d;
}

/* Search Section */
.search-section {
    background: white;
    padding: 24px;
    margin: 0 auto 24px auto;
    max-width: 1300px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: 100%;
}


.search-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #6b5b4d;
    box-shadow: 0 0 0 3px rgba(107, 91, 77, 0.1);
}

.search-button {
    background: #6b5b4d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.search-button:hover {
    background: #5a4a3d;
}

/* Results Info */
.results-info {
 background: #f8f9fa;     
 padding: 16px 24px;    
 margin: 0 auto 16px auto;    
 max-width: 1300px;     
 border-radius: 8px;    
 border-left: 4px solid #6b5b4d;
 width: 100%;
}

.results-count {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Grid container and items - needed for images to show */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.grid-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Image Container - CRITICAL for images to display */
.image-container {
    position: relative;
    width: 100%;
    height: 250px;
    background: #f5f5f5;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.image-container.loading img {
    opacity: 0;
}

.image-container:not(.loading) img {
    opacity: 1;
}

/* Loading Animation */
.image-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.image-container:not(.loading) .image-placeholder {
    opacity: 0;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Item Info */
.item-info {
    padding: 16px;
}

.item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #2c3e50;
    line-height: 1.3;
}

.item-category {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 0 0 4px 0;
}

.item-date {
    font-size: 0.85rem;
    color: #95a5a6;
    margin: 0;
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: #2c3e50;
}

/* Pagination */
.pagination-section {
    background: white;
    padding: 20px;
    margin: 24px auto;
    max-width: 1400px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-btn {
    background: #6b5b4d;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn:not(:disabled):hover {
    background: #5a4a3d;
}

.pagination-info,
#page-info {
    font-size: 0.95rem;
    color: #666;
    margin: 0 12px;
    font-weight: 500;
}

/* Loading States */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6b5b4d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
    margin: 20px auto;
    max-width: 600px;
}

.error-message h3 {
    margin-bottom: 8px;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    gap: 8px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .filter-actions {
        justify-content: center;
        margin-top: 16px;
    }
    
    .clear-filters {
        flex: 1;
        max-width: 200px;
    }
    
    .search-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-button {
        margin-top: 8px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .pagination-controls {
        display: flex;
        gap: 8px;
    }
}

/* ═══════════════════════════════════════════════
   ENHANCED MOBILE GRID RESPONSIVENESS
   ═══════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 992px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
        padding: 20px;
    }
    
    .filter-section,
    .search-section,
    .results-info,
    .pagination-section {
        margin-left: 16px;
        margin-right: 16px;
        max-width: calc(100% - 32px);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
        padding: 16px;
    }
    
    .image-container {
        height: 200px;
    }
    
    .item-info {
        padding: 12px;
    }
    
    .item-title {
        font-size: 1rem;
    }
    
    .filter-section,
    .search-section {
        padding: 16px;
        margin: 16px;
        border-radius: 8px;
    }
}

/* Small Mobile (iPhone SE, etc.) */
@media (max-width: 480px) {
    .grid-container {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 12px;
    }
    
    .grid-item {
        max-width: 100%;
    }
    
    .image-container {
        height: 220px;
    }
    
    .item-title {
        font-size: 0.95rem;
    }
    
    .item-category,
    .item-date {
        font-size: 0.8rem;
    }
    
    .filter-section,
    .search-section,
    .results-info,
    .pagination-section {
        margin: 12px;
        padding: 14px;
        max-width: calc(100% - 24px);
    }
    
    .filter-group select,
    .search-input {
        padding: 14px 12px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .pagination-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    
    .results-count {
        font-size: 0.85rem;
    }
}

/* Very Small Screens */
@media (max-width: 360px) {
    .grid-container {
        padding: 8px;
        gap: 12px;
    }
    
    .filter-section,
    .search-section {
        margin: 8px;
        padding: 12px;
    }
}

/* FORCE SINGLE COLUMN ON MOBILE */
@media (max-width: 600px) {
    .grid-container {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 16px !important;
    }
    
    .grid-item {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .image-container {
        height: 250px !important;
    }
}