/* Plate Details Modal Styles */
.plate-details-modal {
    position: fixed;
    inset: 0;
    z-index: 980;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.plate-details-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.plate-details-modal.closing {
    opacity: 0;
}

.plate-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
}

.plate-details-modal.active .plate-modal-backdrop {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.plate-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease-out;
    z-index: 1;
}

.plate-details-modal.active .plate-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.plate-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    z-index: 5;
    transition: background 0.2s;
}

.plate-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.plate-modal-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 768px) {
    .plate-modal-body {
        flex-direction: row;
        max-height: 90vh;
    }
}

.plate-modal-number-container {
    position: relative;
    height: 200px;
    width: 100%;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Plate image from Supabase storage */
.plate-modal-image {
    max-width: 65%; /* Reduced from 70% to make plate smaller */
    max-height: 65%; /* Reduced from 70% to make plate smaller */
    width: auto;
    height: auto;
    object-fit: contain;
}

@media (min-width: 768px) {
    .plate-modal-number-container {
        flex: 0 0 45%;
        min-height: 300px;
    }
}

.modal-features {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Mobile: Move badges to top right of info section, opposite the price */
@media (max-width: 767px) {
    .plate-modal-number-container {
        position: static;
    }
    
    .modal-features {
        position: absolute;
        bottom: auto;
        left: auto;
        top: 210px; /* Below the 200px plate container + some padding */
        right: 25px; /* Match the padding of plate-modal-info */
        z-index: 10;
    }
    
    .plate-modal-info {
        position: relative;
        padding-top: 25px;
    }
    
    .plate-modal-price {
        padding-right: 80px; /* Make room for badges on the right */
    }
}

.modal-feature-tag {
    background: transparent;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
}

.modal-feature-tag .feature-emoji {
    font-size: 20px;
}

/* Modal stats (view count and favorite count) */
.modal-stats {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 10px;
}

.modal-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.modal-stat svg {
    opacity: 0.9;
}

.modal-stat:first-child svg {
    color: #fff;
}

.modal-stat:last-child svg {
    color: #e74c3c;
}
    line-height: 1;
}

.modal-feature-tag:nth-child(1) {
    background: transparent;
}

.modal-feature-tag:nth-child(2) {
    background: transparent;
}

.modal-feature-tag:nth-child(3) {
    background: transparent;
}

.plate-modal-info {
    padding: 25px;
    flex: 1;
    overflow: auto;
    text-align: left;
}

.plate-modal-price {
    font-size: 30px;
    font-weight: 700;
    color: #8B0000;
    margin-bottom: 20px;
}

.plate-modal-description {
    margin-bottom: 30px;
    color: #555;
    line-height: 1.6;
}

.plate-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

@media (min-width: 480px) {
    .plate-modal-actions {
        flex-direction: row;
    }
}

.plate-modal-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f5f5f5;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
}

.plate-modal-action:hover {
    background: #ebebeb;
}

.contact-action:hover {
    background: #128C7E; /* WhatsApp darker green */
}

/* Contact Seller Button Styles */
.contact-seller-btn {
    background-color: #25D366; /* WhatsApp green */
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.contact-seller-btn svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.contact-seller-btn:hover {
    background-color: #128C7E; /* Darker WhatsApp green */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.contact-seller-btn:active {
    transform: translateY(0);
}

/* Contact form */
.seller-contact-form {
    display: none;
    border-top: 1px solid #eee;
}

.seller-contact-form h4 {
    margin: 0 0 10px;
    font-size: 16px;
}

.seller-contact-form textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    margin-bottom: 12px;
    font-family: inherit;
}

.seller-contact-form textarea:focus {
    outline: none;
    border-color: #8B0000;
}

.send-message-btn {
    background: #8B0000;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.send-message-btn:hover {
    background: #a50000;
}

.send-message-btn.success {
    background: #2ecc71;
}

/* Improved seller profile link styling */
.seller-profile-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    transition: all 0.2s ease;
    padding: 12px;
    margin: 5px -12px;
    position: relative;
}

.seller-profile-link:hover {
    background-color: #f5f5f5;
}

.seller-profile-link:active {
    background-color: #f0f0f0;
}

.seller-info {
    display: flex;
    align-items: center;
}

.seller-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #e1e1e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    margin-right: 12px;
    flex-shrink: 0;
    border: 1px solid #ddd;
}

.seller-details {
    flex: 1;
}

.seller-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 2px;
}

.seller-verification {
    color: #2ecc71;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.seller-rating {
    font-size: 13px;
}

.seller-view-profile {
    font-size: 14px;
    color: #8B0000;
    font-weight: 500;
    display: flex;
    align-items: center;
    margin-left: auto;
    padding-left: 15px;
    flex-shrink: 0;
}

.seller-view-profile .arrow {
    transition: transform 0.2s;
    margin-left: 4px;
}

.seller-profile-link:hover .arrow {
    transform: translateX(3px);
}

.stars {
    color: #f39c12;
    letter-spacing: 2px;
}

.rating-count {
    color: #777;
    margin-left: 4px;
}

/* Seller name clickable styling */
.seller-name-container {
    margin-bottom: 5px;
}

.seller-name-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    position: relative;
    padding: 2px 0;
}

.seller-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    position: relative;
}

.seller-name::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #8B0000;
    transition: width 0.2s ease;
}

.seller-name-link:hover .seller-name::after {
    width: 100%;
}

.view-profile-text {
    font-size: 13px;
    color: #8B0000;
    opacity: 0;
    transform: translateX(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.seller-name-link:hover .view-profile-text {
    opacity: 1;
    transform: translateX(0);
    color: inherit;
    position: relative;
    padding: 2px 0;
}

.seller-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    position: relative;
}

.seller-name::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #8B0000;
    transition: width 0.2s ease;
}

.seller-name-link:hover .seller-name::after {
    width: 100%;
}

.view-profile-text {
    font-size: 13px;
    color: #8B0000;
    opacity: 0;
    transform: translateX(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.seller-name-link:hover .view-profile-text {
    opacity: 1;
    transform: translateX(0);
}

/* Favorite counter styles */
.plate-detail-stats {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 15px;
    background: rgba(139, 0, 0, 0.05);
    border-radius: 12px;
}

.favorite-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
}

.favorite-counter svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-color);
    stroke: var(--primary-color);
}

.favorite-count {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    animation: countIn 0.3s ease;
}

.favorite-label {
    font-size: 14px;
    color: #666;
    margin-left: 4px;
}

/* Animation for counter */
@keyframes countIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .plate-detail-stats {
        margin: 15px 0;
        padding: 12px;
    }
    
    .favorite-count {
        font-size: 20px;
    }
    
    .favorite-label {
        font-size: 13px;
    }
}

.favorite-label {
    font-size: 14px;
    color: #666;
    margin-left: 4px;
}

/* Animation for counter */
@keyframes countIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .plate-detail-stats {
        margin: 15px 0;
        padding: 12px;
    }
    
    .favorite-count {
        font-size: 20px;
    }
    
    .favorite-label {
        font-size: 13px;
    }
}

/* Plate Details Modal styling for different plate types - FADE OVERLAY APPROACH */

/* Sponsored plate details modal - match actual sponsored plate styling */
.plate-details-modal.sponsored-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, rgba(59, 3, 13, 0.15) 0%, rgba(94, 9, 24, 0.12) 45%, rgba(124, 15, 35, 0.08) 70%, rgba(59, 3, 13, 0.15) 100%);
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.plate-details-modal.sponsored-modal .plate-modal-content {
    position: relative;
    background: linear-gradient(145deg, #3b030d 0%, #5e0918 45%, #7c0f23 70%, #3b030d 100%);
    border: 2px solid #d4af37;
    box-shadow: 0 8px 22px -6px rgba(0,0,0,0.55);
    z-index: 2;
}

.plate-details-modal.sponsored-modal .plate-modal-close {
    background: linear-gradient(135deg, #d4af37, #b88d10);
    color: #2a1500;
    border: 1px solid rgba(110, 70, 0, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    z-index: 10;
}

.plate-details-modal.sponsored-modal .plate-modal-close:hover {
    background: linear-gradient(135deg, #e6c547, #d4af37);
    transform: scale(1.1);
}

.plate-details-modal.sponsored-modal .plate-modal-number-container {
    background: linear-gradient(160deg, #1c0107, #31040f 55%, #4b0918);
    border-bottom: 1px solid #d4af37;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 4px 14px -4px rgba(0,0,0,0.65);
}

.plate-details-modal.sponsored-modal .plate-modal-number {
    background: transparent;
    border: none;
    color: #1a1a1a;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    box-shadow: none;
}

.plate-details-modal.sponsored-modal .plate-modal-info {
    background: linear-gradient(145deg, #3b030d 0%, #5e0918 45%, #7c0f23 70%, #3b030d 100%);
    color: #f1d79b;
    position: relative;
    z-index: 2;
}

.plate-details-modal.sponsored-modal .plate-modal-price {
    color: #f1d79b !important;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.plate-details-modal.sponsored-modal .plate-modal-description p {
    color: #f1d79b !important;
}

.plate-details-modal.sponsored-modal h4 {
    color: #f1d79b !important;
}

.plate-details-modal.sponsored-modal .seller-stat {
    color: #f1d79b !important;
}

.plate-details-modal.sponsored-modal .plate-modal-action {
    background: linear-gradient(135deg, #d4af37, #b88d10);
    color: #2a1500;
    border: 1px solid rgba(110, 70, 0, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    font-weight: 700;
}

.plate-details-modal.sponsored-modal .plate-modal-action:hover {
    background: linear-gradient(135deg, #e6c547, #d4af37);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 105, 20, 0.4);
}

.plate-details-modal.sponsored-modal .sponsored-label {
    background: linear-gradient(135deg, #d4af37, #b88d10);
    color: #2a1500;
    letter-spacing: 0.5px;
    font-weight: 700;
    border: 1px solid rgba(110, 70, 0, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* Champagne/Golden plate details modal - fade overlay */
.plate-details-modal.champagne-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(249, 244, 230, 0.2) 0%, rgba(240, 230, 140, 0.15) 30%, rgba(218, 165, 32, 0.12) 70%, rgba(184, 134, 11, 0.2) 100%);
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.plate-details-modal.champagne-modal .plate-modal-content {
    position: relative;
    background: linear-gradient(135deg, #f9f4e6 0%, #f5edd4 50%, #e6d16a 100%) !important;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(212, 175, 55, 0.6) !important;
    box-shadow: 
        0 20px 60px rgba(139, 105, 20, 0.6),
        0 0 40px rgba(212, 175, 55, 0.3) !important;
}

.plate-details-modal.champagne-modal .plate-modal-close {
    background: linear-gradient(135deg, #d4af37, #b88d10) !important;
    color: #2a1500 !important;
    border: 1px solid rgba(139, 105, 20, 0.4) !important;
    box-shadow: 0 2px 4px rgba(139, 105, 20, 0.25);
    z-index: 10;
}

.plate-details-modal.champagne-modal .plate-modal-close:hover {
    background: linear-gradient(135deg, rgba(230, 197, 71, 0.95), rgba(212, 175, 55, 0.95));
    transform: scale(1.1);
}

.plate-details-modal.champagne-modal .plate-modal-number-container {
    background: linear-gradient(135deg, #f9f4e6 0%, #e6d16a 50%, #d4af37 100%) !important;
    border-bottom: 2px solid rgba(212, 175, 55, 0.8) !important;
    position: relative;
    z-index: 2;
}

.plate-details-modal.champagne-modal .plate-modal-number {
    background: transparent !important;
    border: none !important;
    color: #1a1a1a !important;
    box-shadow: none !important;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.plate-details-modal.champagne-modal .plate-modal-info {
    background: linear-gradient(145deg, #f9f4e6 0%, #f0e6a0 45%, #e6d16a 70%, #d4af37 100%) !important;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(5px);
}

.plate-details-modal.champagne-modal .plate-modal-price {
    color: #5a4a0d !important;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.plate-details-modal.champagne-modal .plate-modal-description p,
.plate-details-modal.champagne-modal h4,
.plate-details-modal.champagne-modal .seller-stat {
    color: #5a4a0d !important;
}

.plate-details-modal.champagne-modal .plate-modal-action {
    background: linear-gradient(135deg, #d4af37, #b88d10) !important;
    color: #2a1500 !important;
    border: 1px solid rgba(139, 105, 20, 0.4) !important;
    font-weight: 700;
}

.plate-details-modal.champagne-modal .plate-modal-action:hover {
    background: linear-gradient(135deg, #e6c547, #d4af37) !important;
    transform: translateY(-2px);
}

/* Normal plate details modal (default) styling - keep as is */
.plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-content {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-close {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-close:hover {
    background: #e9e9e9;
    transform: scale(1.1);
}

.plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-number-container {
    background: linear-gradient(135deg, #fff 0%, #f8f8f8 100%);
    border-bottom: 1px solid #e0e0e0;
}

.plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-number {
    background: transparent;
    border: none;
    color: #1a1a1a;
    box-shadow: none;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-info {
    background: #ffffff;
    color: #31302c;
}

.plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-action {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-action:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

/* Dark mode styling for normal plate details modal */
body.dark-theme .plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
    border: 1px solid #404040 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
}

body.dark-theme .plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-close {
    background: #404040 !important;
    color: #e0e0e0 !important;
    border: 1px solid #555 !important;
}

body.dark-theme .plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-close:hover {
    background: #555 !important;
}

body.dark-theme .plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-number-container {
    background: linear-gradient(135deg, #3a3a3a 0%, #2d2d2d 100%) !important;
    border-bottom: 1px solid #404040 !important;
}

body.dark-theme .plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-number {
    background: transparent !important;
    border: none !important;
    color: #1a1a1a !important;
    box-shadow: none !important;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8) !important;
}

body.dark-theme .plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-info {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
    color: #e0e0e0 !important;
}

body.dark-theme .plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-price,
body.dark-theme .plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-description p,
body.dark-theme .plate-details-modal:not(.sponsored-modal):not(.champagne-modal) h4,
body.dark-theme .plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .seller-stat {
    color: #e0e0e0 !important;
}

body.dark-theme .plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-action {
    background: #404040 !important;
    color: #e0e0e0 !important;
    border: 1px solid #555 !important;
}

body.dark-theme .plate-details-modal:not(.sponsored-modal):not(.champagne-modal) .plate-modal-action:hover {
    background: #555 !important;
}

/* Improve readability of seller stats in plate modal (replace yellow) */
.plate-details-modal .seller-stats-row {
    color: #e9e9e9 !important;
}

/* Seller stats: use dark maroon for all text in the block */
.plate-details-modal .seller-stats-row,
.plate-details-modal .seller-stat,
.plate-details-modal .seller-stat strong,
.plate-details-modal .seller-stat-divider {
    color: #8B0000 !important;
}

/* Seller stats color adjustments: labels black, values maroon */
.plate-details-modal .seller-stat,
.plate-details-modal .seller-stat-divider,
.plate-details-modal #seller-join-date {
    color: #000000 !important; /* labels and divider */
}

.plate-details-modal .seller-stat strong,
.plate-details-modal #seller-join-date strong {
    color: #8B0000 !important; /* numeric count and date */
}


