/* Custom Styles for Goods Pricing Storage */
/* ========================================= */

/* Override Bootstrap Variables for Gray Theme */
:root {
    --bs-primary: #6c757d;
    --bs-primary-rgb: 108, 117, 125;
    --bs-secondary: #adb5bd;
    --bs-light: #f8f9fa;
    --bs-dark: #343a40;
}

/* Custom body styling */
body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; 
    background: linear-gradient(310deg, #f8f9fa 0%, #e9ecef 100%);
    font-size: 0.8rem;
    color: #495057;
}

/* Animation for page load */
.container-fluid { 
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease;
}

/* Animation classes for smooth loading */
.container-fluid.loading {
    opacity: 0;
    transform: translateY(20px);
}

.container-fluid.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Custom component styles that extend Bootstrap */

/* Price display styles */
.price-location {
    color: #718096;
    font-size: 0.9rem;
    margin: 4px 0;
}

.price-shop {
    color: #718096;
    font-size: 0.9rem;
    margin: 4px 0;
}

/* Statistics display */
.stats-table {
    display: grid;
    gap: 0.5rem;
}

.stat-item {
    background: white;
    border-radius: 0.375rem;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    transition: all 0.15s ease-in-out;
    border-left: 3px solid transparent;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-left-color: #6c757d;
}

.clickable-stat {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #667eea;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stat-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #667eea;
}

.stat-value.positive {
    color: #48bb78;
}

.stat-value.negative {
    color: #f56565;
}

.stat-details {
    color: #718096;
    font-size: 0.9rem;
}

.positive {
    color: #48bb78;
    font-weight: 600;
}

.negative {
    color: #f56565;
    font-weight: 600;
}

/* Legacy form compatibility */
.form-input {
    /* Maintained for JavaScript compatibility */
}

/* Products grid layout */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.product-card {
    background: white;
    border-radius: 0.375rem;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #adb5bd;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.product-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.25rem;
}

.product-category {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.product-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 0.8rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
    flex-direction: column;
    gap: 8px;
}

.price-range {
    font-size: 0.9rem;
    color: #4a5568;
}

.last-update {
    font-size: 0.8rem;
    color: #718096;
    margin: 5px 0;
    font-style: italic;
}

.view-details {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-details:hover {
    background: #5a67d8;
    transform: translateX(2px);
}

.no-results {
    text-align: center;
    color: #718096;
    padding: 60px;
    font-size: 1.1rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2d3748;
    text-align: center;
}

.modal .close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #718096;
}

.modal .close:hover {
    color: #2d3748;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Legacy button styles - replaced by Bootstrap buttons */

/* Product Details Page Styles */
.product-header {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.product-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.full-width {
    grid-column: 1 / -1;
    margin-bottom: 30px;
}

.chart-container {
    position: relative;
    height: 300px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 15px;
}

#priceChart {
    max-height: 260px !important;
    width: 100% !important;
}

.price-item {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.price-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.price-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.price-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
}

.price-location {
    color: #718096;
    font-size: 0.9rem;
}

.price-date {
    color: #a0aec0;
    font-size: 0.8rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.photo-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

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

/* Animation overrides for shared loading */
.loading::after {
    content: '';
    animation: dots 2s infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .add-product-btn {
        width: 100%;
    }
    
    .product-preview {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .view-details {
        text-align: center;
    }
}

/* Legacy header styles - replaced by Bootstrap navbar */

/* Legacy page titles - replaced by Bootstrap typography */

/* Legacy section cards - replaced by Bootstrap cards */

/* Legacy grid layouts - replaced by Bootstrap grid system */

/* Statistics styling */
.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.625rem;
    letter-spacing: 0.5px;
}

/* Section titles */
.section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    border-bottom: 2px solid #adb5bd;
    padding-bottom: 0.25rem;
}

/* Price Items */
.price-item {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 5px solid #667eea;
    transition: all 0.3s ease;
}

.price-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.price-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #38a169;
}

.price-location {
    color: #4a5568;
    font-weight: 600;
}

.price-shop {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.price-date {
    color: #a0aec0;
    font-size: 0.8rem;
    text-align: right;
}

/* Forms */
.search-bar, .form-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.search-input, .form-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus, .form-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

select, input, button {
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

select:focus, input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Legacy button overrides - replaced by Bootstrap buttons */

/* Photo Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.photo-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

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

.photo-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.photo-item:hover .photo-overlay {
    transform: translateY(0);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    transition: all 0.3s ease;
}

.modal.show {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    padding: 20px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.9);
    transition: all 0.3s ease;
}

.modal.show .modal-content {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-img {
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    object-fit: contain;
}

.close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #666;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.close:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.modal-info {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-price {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.modal-location {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 4px;
    font-weight: 500;
}

.modal-date {
    font-size: 14px;
    color: #718096;
    font-style: italic;
}

/* Loading and Error States */
.loading {
    text-align: center;
    color: #667eea;
    padding: 40px;
    font-size: 1.1rem;
    font-weight: 500;
}

.loading::after {
    content: '';
    animation: dots 2s infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

.no-data {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 40px;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 15px;
    border: 2px dashed #cbd5e0;
}

.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 4px solid #28a745;
}

.error {
    background: linear-gradient(135deg, #f8d7da, #f1aeb5);
    color: #721c24;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 4px solid #dc3545;
}

/* Utility Classes */
.positive {
    color: #28a745 !important;
    font-weight: bold;
}

.negative {
    color: #dc3545 !important;
    font-weight: bold;
}

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

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* Simple Searchable Select */
.select-with-search {
    position: relative;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.dropdown-list.show {
    display: block;
}

.dropdown-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.dropdown-option:hover {
    background-color: #f3f4f6;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option .category {
    color: #6b7280;
    font-size: 0.85em;
    margin-left: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .nav {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .nav a {
        width: 100%;
        text-align: center;
        max-width: 200px;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .price-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* EUR Price Display - smaller, light gray text */
.eur-price {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 0.25rem;
}

/* Mobile responsive adjustments for EUR price */
@media (max-width: 768px) {
    .eur-price {
        font-size: 0.65rem;
        display: block;
        margin-left: 0;
        margin-top: 0.125rem;
    }
}