/* --- Google App Showcase v3.0 - ShadCN Inspired Design --- */
:root {
    --gas-background: #ffffff;
    --gas-foreground: #09090b;
    --gas-card: #ffffff;
    --gas-card-foreground: #09090b;
    --gas-popover: #ffffff;
    --gas-popover-foreground: #09090b;
    --gas-primary: #1a73e8;
    --gas-primary-foreground: #fafafa;
    --gas-secondary: #f4f4f5;
    --gas-secondary-foreground: #18181b;
    --gas-muted: #f4f4f5;
    --gas-muted-foreground: #71717a;
    --gas-accent: #f4f4f5;
    --gas-accent-foreground: #18181b;
    --gas-border: #e4e4e7;
    --gas-radius: 0.75rem; /* 12px */
}

/* Base Card Component */
.gas-card {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--gas-card);
    color: var(--gas-card-foreground);
    border: 1px solid var(--gas-border);
    border-radius: var(--gas-radius);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    overflow: hidden;
    max-width: 520px;
    margin: 2rem auto;
}

/* Card Sections */
.gas-card-header,
.gas-card-content,
.gas-card-footer {
    padding: 1rem; /* 24px */
}
.gas-card-header {
    display: flex;
    align-items: center;
    gap: 1rem; /* 16px */
}
.gas-card-content {
    padding-top: 0.35rem; /* 12px */
}
.gas-card-footer {
    background-color: var(--gas-muted);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gas-border);
}

/* Card Elements */
.gas-icon {
    width: 72px;
    height: 72px;
    border-radius: 0.6rem;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--gas-border);
}
.gas-title-group {
    flex-grow: 1;
}
.gas-title {
    margin: 0;
    font-size: 1.25rem; /* 20px */
    font-weight: 700;
    line-height: 1.2;
    color: var(--gas-card-foreground);
}
.gas-developer {
    margin: 0.25rem 0 0;
    font-size: 0.875rem; /* 14px */
    color: var(--gas-muted-foreground);
}
.gas-description {
    font-size: 0.95rem; /* 15px */
    line-height: 1.6;
    color: var(--gas-muted-foreground);
    margin: 0 0 1rem;
}
.gas-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* 8px */
}

/* Badge Component */
.gas-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    background-color: var(--gas-secondary);
    color: var(--gas-secondary-foreground);
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem; /* 13px */
    font-weight: 500;
}

/* Media Section (Video/Screenshots) */
.gas-media-section {
    padding: 0 1.5rem 1.5rem;
}
.gas-video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    border-radius: calc(var(--gas-radius) - 4px);
    overflow: hidden;
    border: 1px solid var(--gas-border);
}
.gas-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.gas-screenshots {
    display: flex;
    gap: 0.75rem; /* 12px */
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}
.gas-screenshots::-webkit-scrollbar { display: none; }
.gas-screenshot {
    height: 200px;
    border-radius: calc(var(--gas-radius) - 4px);
    border: 1px solid var(--gas-border);
    object-fit: cover;
}

/* Button Component */
.gas-download-button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem; /* 8px */
    background-color: var(--gas-primary);
    color: var(--gas-primary-foreground) !important;
    padding: 0.75rem 1rem;
    font-size: 1rem; /* 16px */
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}
.gas-download-button:hover {
    background-color: #1c6ad6; /* A slightly darker blue */
}

/* Popup Styles */
#gas-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 50000;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}
#gas-popup-content {
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    animation: gas-popup-slidein 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#gas-popup-content::-webkit-scrollbar { display: none; }
#gas-popup-content .gas-card {
    margin: 0; /* Remove auto margin inside popup */
}
@keyframes gas-popup-slidein {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- MODIFIED CLOSE BUTTON START --- */
#gas-popup-close {
    position: absolute;
    top: 2rem;
    right: 0.75rem;
    /* Removed background, border-radius, width, and height */
    background: none;
    border: none;
    color: #000000; /* White color for high contrast on dark overlay */
    cursor: pointer;
    font-size: 2.5rem; /* Made the X larger */
    line-height: 1; /* Tight line height */
    padding: 0.5rem; /* Increased clickable area */
    z-index: 10;
    opacity: 0.7; /* Slightly transparent by default */
    text-shadow: 0 1px 2px rgba(0,0,0,0.3); /* Shadow for better visibility */
    transition: all 0.2s ease-in-out;
}
#gas-popup-close:hover {
    opacity: 1;
    transform: scale(1.1); /* Slight zoom on hover */
}
/* --- MODIFIED CLOSE BUTTON END --- */

.gas-popup-heading {
    text-align: center;
    font-size: 0.875rem;
    color: var(--gas-muted-foreground);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Compact View Styles --- */
.gas-card-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    overflow: visible; /* Override default */
}
.gas-card-compact .gas-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}
.gas-card-compact .gas-compact-content {
    flex-grow: 1; /* Take up available space */
    min-width: 0; /* Prevents overflow issues in flex children */
}
.gas-card-compact .gas-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gas-card-compact .gas-developer {
    font-size: 0.8rem;
    margin-top: 0.1rem;
}
.gas-card-compact .gas-metadata {
    margin-top: 0.25rem;
}
.gas-card-compact .gas-download-button {
    flex-shrink: 0; /* Don't shrink the button */
    width: auto; /* Override default 100% width */
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}


/* Mobile Responsive */
@media (max-width: 640px) {
    .gas-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .gas-icon {
        width: 90px;
        height: 90px;
    }
    .gas-card-header,
    .gas-card-content,
    .gas-card-footer {
        padding: 0.75rem;
    }
    .gas-media-section {
        padding: 0 1rem 1rem;
    }
    .gas-title {
        font-size: 1.125rem;
    }
    .gas-screenshot {
     height: 175px;
    }

    /* Make compact view more mobile friendly */
    .gas-card-compact {
        gap: 0.75rem;
        padding: 0.75rem;
    }
    .gas-card-compact .gas-icon {
        width: 48px;
        height: 48px;
    }
     .gas-card-compact .gas-download-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* --- Scroll Lock Fix for Popup --- */
body.gas-popup-active {
    overflow: hidden;
}