/* GoMarket — Minimalistic Google + Functional Facebook Marketplace */

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

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background-color: #ffffff;
    color: #202124;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header */
#gm-header {
    position: sticky;
    top: 0;
    height: 56px;
    background-color: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}

#gm-header > * {
    flex: 1;
    display: flex;
    align-items: center;
}

#gm-header .gm-logo {
    font-size: 18px;
    font-weight: 500;
    color: #1f2937;
    letter-spacing: 0.5px;
}

#gm-header .gm-icons {
    justify-content: flex-end;
    gap: 4px;
}

.gm-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background-color 0.2s ease;
    color: #5f6368;
}

.gm-icon-btn:hover {
    background-color: #f8f9fa;
}

.gm-icon-btn:active {
    background-color: #e8eaed;
}

/* Main View */
#gm-root-view {
    display: block;
    width: 100%;
    min-height: calc(100vh - 56px);
    background-color: #ffffff;
    overflow-y: auto;
}

/* Location bar */
.gm-location-bar {
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e8e8e8;
    font-size: 13px;
    color: #5f6368;
}

.gm-location-bar strong {
    color: #202124;
    font-weight: 500;
}

/* Grid for feed cards */
.gm-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.gm-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #e8e8e8;
    transition: all 0.2s ease;
}

.gm-card:hover {
    border-color: #dadce0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.gm-card:active {
    opacity: 0.95;
}

.gm-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background-color: #f0f0f0;
    display: block;
}

.gm-card-meta {
    padding: 10px 12px;
}

.gm-card-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: #202124;
    margin-bottom: 4px;
}

.gm-card-price {
    color: #1f2937;
    font-weight: 600;
    font-size: 14px;
}

.gm-card-location {
    font-size: 12px;
    color: #5f6368;
    margin-top: 2px;
}

/* Skeletons */
.gm-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Listing details */
.gm-listing {
    background: #ffffff;
    min-height: 100vh;
}

.gm-listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
}

.gm-listing-header h2 {
    font-size: 16px;
    font-weight: 500;
    color: #202124;
}

.gm-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    color: #5f6368;
}

.gm-back-btn:hover {
    background-color: #f8f9fa;
}

.gm-listing-image-container {
    width: 100%;
    aspect-ratio: 1;
    background-color: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.gm-listing-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gm-listing-image.blur-up {
    animation: blurUpFadeIn 0.4s ease-out;
}

@keyframes blurUpFadeIn {
    from {
        opacity: 0.6;
        filter: blur(8px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

.gm-listing-content {
    max-width: 800px;
    margin: 0 auto;
}

.gm-listing-meta {
    padding: 16px;
}

.gm-listing-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #202124;
    line-height: 1.4;
}

.gm-listing-price {
    font-size: 20px;
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 16px;
}

.gm-listing-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.gm-btn {
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.gm-btn:hover {
    background-color: #f8f9fa;
    border-color: #dadce0;
}

.gm-btn:active {
    background-color: #e8eaed;
}

.gm-btn-primary {
    background-color: #1f2937;
    color: #ffffff;
    border-color: #1f2937;
}

.gm-btn-primary:hover {
    background-color: #374151;
}

/* Details section */
.gm-details {
    padding: 16px;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    margin: 12px 0;
}

.gm-details-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
}

.gm-details-row:last-child {
    margin-bottom: 0;
}

.gm-details-label {
    color: #5f6368;
    font-weight: 500;
}

.gm-details-value {
    color: #202124;
}

.gm-description {
    padding: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #202124;
}

.gm-description p {
    margin-bottom: 12px;
}

.gm-description p:last-child {
    margin-bottom: 0;
}

/* Seller info */
.gm-seller-section {
    padding: 16px;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    margin-top: 12px;
}

.gm-seller-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.gm-seller-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 4px;
}

.gm-seller-info p {
    font-size: 12px;
    color: #5f6368;
}

.gm-seller-action {
    padding: 6px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #1f2937;
    transition: all 0.2s;
}

.gm-seller-action:hover {
    background-color: #f8f9fa;
}

/* Responsive */
@media (min-width: 640px) {
    .gm-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .gm-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        padding: 16px;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

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

.text-muted {
    color: #5f6368;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bcc0c4;
}
