/* Custom CSS for eBay-like E-commerce Platform */

/* Global Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

.text-warning-custom {
    color: #ffe066 !important;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
}

/* Header Styles */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar .form-control {
    border-radius: 25px 0 0 25px;
    border-right: none;
}

.navbar .form-select {
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.navbar .btn {
    border-radius: 0 25px 25px 0;
}

/* Card Styles */
.card {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Category Card Styles */
.category-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.category-card .category-icon {
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-card h5 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.category-card:hover h5 {
    color: var(--primary-color);
}

/* Category Links in Header */
.category-link {
    transition: color 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.category-link:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color) !important;
}
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    background-color: #343a40; /* Background scuro per le card */
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Product Card Styles */
.product-card {
    overflow: hidden;
}

.product-card .card-img-top {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    transition: var(--transition);
}

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

.product-card .badge {
    font-size: 0.7rem;
    border-radius: 15px;
}

.product-card .price-section {
    background-color: var(--light-color);
    margin: 0 -1.25rem;
    padding: 1rem 1.25rem;
}

/* Product Title and Description Styles - Colore Chiaro */
.product-card .card-title,
.product-card .card-title a {
    color: #e9ecef !important; /* Grigio molto chiaro */
    font-weight: 600;
    text-decoration: none;
}

.product-card .card-title a:hover {
    color: #ffffff !important; /* Bianco al hover */
    text-decoration: none;
}

.product-card .card-text {
    color: #ced4da !important; /* Grigio chiaro per la descrizione */
}

/* Titoli prodotti nelle altre sezioni */
.card-title,
h6.card-title {
    color: #f8f9fa !important; /* Grigio molto chiaro */
}

.card-title a,
h6.card-title a {
    color: #e9ecef !important;
    text-decoration: none;
}

.card-title a:hover,
h6.card-title a:hover {
    color: #ffffff !important;
}

/* Assicura che il testo sui prezzi rimanga visibile */
.product-card .text-muted {
    color: #adb5bd !important;
}

.product-card .price-section {
    background-color: #495057; /* Background più scuro per la sezione prezzo */
    margin: 0 -1.25rem;
    padding: 1rem 1.25rem;
}

/* Informazioni venditore */
.product-card .seller-info {
    color: #ced4da !important;
}

.product-card .seller-info small {
    color: #adb5bd !important;
}

/* Button Styles */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    padding: 0.5rem 1.5rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(45deg, #0d6efd, #3d8bfd);
}

.btn-success {
    background: linear-gradient(45deg, #198754, #20c997);
}

.btn-warning {
    background: linear-gradient(45deg, #ffc107, #ffcd39);
    color: #000;
}

.btn-danger {
    background: linear-gradient(45deg, #dc3545, #e74c3c);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
}

/* Category Styles */
.category-card {
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Auction Styles */
.auction-card {
    border-left: 4px solid var(--warning-color);
}

.auction-timer {
    background: rgba(255, 193, 7, 0.1);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}

/* Rating Stars */
.rating-stars {
    color: var(--warning-color);
}

.rating-stars .fas {
    margin-right: 2px;
}

/* Search and Filter Styles */
.search-filters {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-section {
    border-right: 1px solid #dee2e6;
}

.filter-section:last-child {
    border-right: none;
}

/* Pagination */
.pagination .page-link {
    border-radius: var(--border-radius);
    margin: 0 2px;
    border: none;
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(45deg, #0d6efd, #3d8bfd);
    border: none;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.input-group .form-control:not(:first-child) {
    border-left: none;
}

.input-group-text {
    background-color: var(--light-color);
    border: 2px solid #e9ecef;
    border-right: none;
}

/* Alert Styles */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.5rem;
}

.alert-success {
    background: linear-gradient(45deg, #d1edff, #e7f3ff);
    color: #0c5460;
}

.alert-danger {
    background: linear-gradient(45deg, #f8d7da, #f5c2c7);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(45deg, #fff3cd, #ffeaa7);
    color: #664d03;
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

footer a {
    transition: var(--transition);
}

footer a:hover {
    color: var(--warning-color) !important;
}

/* Badge Styles */
.badge {
    border-radius: 15px;
    font-weight: 500;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Utilities */
@media (max-width: 768px) {
    .navbar .form-control {
        border-radius: var(--border-radius);
        margin-bottom: 0.5rem;
    }
    
    .navbar .form-select,
    .navbar .btn {
        border-radius: var(--border-radius);
    }
    
    .hero-section {
        padding: 40px 0;
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2.5rem;
    }
    
    .category-card {
        margin-bottom: 1rem;
    }
    
    .product-card .card-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

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

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.cursor-pointer {
    cursor: pointer;
}

.min-height-100vh {
    min-height: 100vh;
}

/* Dark Theme Support (Optional) */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        color: white;
    }
    
    .form-control,
    .form-select {
        background-color: #4a5568;
        border-color: #718096;
        color: white;
    }
    
    .input-group-text {
        background-color: #4a5568;
        border-color: #718096;
        color: white;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .alert {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
}
