/* Lista annunci */
.marketplace-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.marketplace-item {
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    background: white;
}

.marketplace-item:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.marketplace-thumbnail {
    height: 150px;
    overflow: hidden;
    position: relative;
}

.marketplace-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.marketplace-item:hover .marketplace-thumbnail img {
    transform: scale(1.05);
}

.no-image {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #777;
    font-size: 14px;
}

.marketplace-content {
    padding: 15px;
}

.marketplace-content h3 {
    margin: 0 0 5px;
    font-size: 18px;
    line-height: 1.3;
}

.marketplace-content h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.marketplace-content h3 a:hover {
    color: #0073aa;
}

.marketplace-author {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.marketplace-author a {
    color: #0073aa;
    text-decoration: none;
}

.marketplace-author a:hover {
    text-decoration: underline;
}

.marketplace-meta {
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-weight: bold;
    color: #4CAF50;
    font-size: 16px;
}

.location {
    color: #666;
    font-size: 14px;
}

.marketplace-contact {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 14px;
}

.login-notice {
    color: #ff0000;
    font-style: italic;
    font-size: 13px;
}

.login-notice a {
    color: #0073aa;
    text-decoration: none;
}

.login-notice a:hover {
    text-decoration: underline;
}

.no-items {
    text-align: center;
    padding: 20px;
    color: #666;
    grid-column: 1 / -1;
    font-size: 16px;
}

.sold-badge {
    position: absolute;
    background: #d9534f;
    color: white;
    padding: 3px 8px;
    margin: 10px;
    border-radius: 3px;
    z-index: 1;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Badge utente verificato */
.verified-badge {
    display: inline-flex;
    align-items: center;
    color: #4CAF50;
    font-size: 13px;
    font-weight: bold;
    margin-left: 5px;
}

.verified-badge svg {
    width: 14px;
    height: 14px;
    fill: #4CAF50;
    margin-right: 3px;
}

/* Form principale */
#marketplace-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

#image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

#image-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: transform 0.3s;
}

#image-preview img:hover {
    transform: scale(1.05);
}

#submit-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    font-size: 16px;
    font-weight: bold;
}

#submit-button:hover {
    background: #006799;
    transform: translateY(-2px);
}

#submit-button:active {
    transform: translateY(0);
}

#form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
    font-size: 14px;
}

#form-message.success {
    background: #e6f7e6;
    color: #2d7b2d;
    border: 1px solid #c3e6c3;
}

#form-message.error {
    background: #f7e6e6;
    color: #7b2d2d;
    border: 1px solid #e6c3c3;
}

/* Pagina singola annuncio */
.marketplace-single {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.marketplace-gallery {
    margin-bottom: 30px;
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.main-image {
    background: #f5f5f5;
    text-align: center;
    padding: 20px;
}

.main-image img {
    max-width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}

.thumbnails img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border-radius: 3px;
}

.thumbnails img:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.marketplace-details {
    background: white;
    padding: 25px;
    border-radius: 5px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.detail-row {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.detail-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.label {
    font-weight: bold;
    width: 120px;
    color: #555;
    flex-shrink: 0;
}

.value {
    flex: 1;
}

.marketplace-content {
    line-height: 1.6;
    padding: 25px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.marketplace-content p {
    margin-bottom: 15px;
}

.marketplace-content p:last-child {
    margin-bottom: 0;
}

.marketplace-message {
    padding: 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    margin: 20px 0;
}

.marketplace-message a {
    color: #0073aa;
    text-decoration: none;
    font-weight: bold;
}

.marketplace-message a:hover {
    text-decoration: underline;
}

/* Form modifica */
.marketplace-edit-form {
    margin-top: 40px;
    padding: 25px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.marketplace-edit-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    color: #333;
}

#update-button {
    background: #5cb85c;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    font-size: 16px;
    font-weight: bold;
}

#update-button:hover {
    background: #4cae4c;
    transform: translateY(-2px);
}

#update-button:active {
    transform: translateY(0);
}

#update-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
    font-size: 14px;
}

#update-message.success {
    background: #e6f7e6;
    color: #2d7b2d;
    border: 1px solid #c3e6c3;
}

#update-message.error {
    background: #f7e6e6;
    color: #7b2d2d;
    border: 1px solid #e6c3c3;
}

/* Responsive */
@media (max-width: 768px) {
    .marketplace-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .detail-row {
        flex-direction: column;
    }
    
    .label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
}

@media (max-width: 480px) {
    .marketplace-list {
        grid-template-columns: 1fr;
    }
    
    #marketplace-form {
        padding: 15px;
    }
    
    .marketplace-single {
        padding: 10px;
    }
    
    .main-image img {
        max-height: 300px;
    }
}

/* Badge utente verificato */
.verified-badge {
    display: inline-flex;
    align-items: center;
    background: #4CAF50;
    color: white;
    padding: 2px 6px 2px 4px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 5px;
    line-height: 1;
    vertical-align: middle;
}

.verified-badge svg {
    width: 12px;
    height: 12px;
    fill: white;
    margin-right: 3px;
}

/* WhatsApp Link */
.whatsapp-link {
    display: inline-block;
    transition: transform 0.2s;
    margin-left: 5px;
}

.whatsapp-link:hover {
    transform: scale(1.1);
}

.whatsapp-link svg {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

/* Pagina di successo */
.marketplace-success-page {
    animation: fadeIn 0.5s ease;
}

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

/* Pulsante con spinner */
#submit-button .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Social share buttons */
.social-share a {
    transition: transform 0.2s;
}

.social-share a:hover {
    transform: scale(1.1);
}