:root {
    --bg-color: #000000;
    --card-bg: #000000;
    --text-color: #ffffff;
    --text-muted: #aaaaaa;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --transition-speed: 0.3s;
}

/* Base Reset */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color); /* Overrides global light/dark default for gallery specifics */
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

/* Override global main padding for the gallery grid */
main#gallery-grid {
    padding-top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Gallery Header Section */
.gallery-header {
    padding: 30px 20px 10px;
    text-align: center;
    background: #000;
    position: relative;
    z-index: 20;
}

.gallery-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

.subtitle {
    color: var(--text-muted);
    margin-top: 5px;
    font-size: 0.9rem;
}

/* Search Bar Styles */
.search-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 50px;
    padding: 8px 15px;
    transition: border-color 0.3s ease;
}

.search-container:focus-within {
    border-color: var(--accent-color);
}

.search-icon {
    display: flex;
    align-items: center;
    color: #666;
    margin-right: 10px;
}

.search-container input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    outline: none;
    padding: 5px 0;
}

.search-container input::placeholder {
    color: #666;
}

#search-btn {
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-left: 10px;
}

#search-btn:hover {
    background: var(--accent-hover);
}

/* Controls */
.gallery-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    font-size: 0.9rem;
}

.control-group select {
    background: #222;
    color: #fff;
    border: 1px solid #444;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* Navigation Tabs */
.tabs-container {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    padding: 15px 20px;
    background: #000;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
    z-index: 20;
    border-bottom: 1px solid #222; /* Subtle separation */
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background-color: #222;
    color: var(--text-color);
    border: 1px solid #333;
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
}

.tab-btn:hover {
    background-color: #333;
}

.tab-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

/* ============================= */
/* FULLSCREEN GALLERY LAYOUT */
/* ============================= */

/* Each image section */
.gallery-card {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
    background-color: #000;
    overflow: hidden;
    border-bottom: 1px solid #111; /* Visual separator between full screen cards */
}

/* Wrapper MUST be full size */
.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Image MUST cover entire screen */
.card-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: opacity 0.4s ease;
}

/* ============================= */
/* TOGGLE BUTTON (TOP RIGHT) */
/* ============================= */

.image-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.image-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.6);
}

/* "New" Badge (Top Left) */
.new-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #22c55e; /* Green accent */
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none; /* Purely visual */
    animation: fadeIn 0.5s ease-out;
}

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

/* ============================= */
/* HOVER / TAP OVERLAY */
/* ============================= */

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85),
        rgba(0, 0, 0, 0) 40%
    );
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
    pointer-events: none;
}

.card-image-wrapper:hover .card-overlay,
.card-image-wrapper.active-mobile .card-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* ============================= */
/* ACTION BUTTONS */
/* ============================= */

.overlay-actions {
    display: flex;
    gap: 15px;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.action-btn {
    padding: 10px 18px;
    top: 20px;
    border: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(6px);
    transition: all 0.2s ease;
}

.like-btn {
    background-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    min-width: 80px;
}

.like-btn:hover {
    background-color: rgba(255, 255, 255, 0.45);
    transform: scale(1.05);
}

.like-btn.liked {
    color: #ff4757;
    background-color: rgba(255, 255, 255, 0.95);
}

.copy-btn-overlay {
    background-color: var(--accent-color);
    color: #fff;
}

.copy-btn-overlay:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.gallery-save-btn {
    background-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 10px; /* Square-ish */
    border-radius: 50%;
    min-width: 44px; /* Ensure touch target */
    justify-content: center;
}

.gallery-save-btn:hover {
    background-color: rgba(255, 255, 255, 0.45);
    transform: scale(1.05);
}

.gallery-save-btn.saved {
    background-color: rgba(46, 204, 113, 0.9);
    color: white;
}

/* Hide prompt text completely */
.card-content {
    display: none !important;
}

/* ============================= */
/* TOAST */
/* ============================= */

#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: rgba(30, 30, 30, 0.95);
    color: #fff;
    text-align: center;
    border-radius: 50px;
    padding: 16px;
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: 50px;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    border: 1px solid var(--accent-color);
    backdrop-filter: blur(10px);
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 80px;
}

/* ============================= */
/* MOBILE ADJUSTMENTS */
/* ============================= */

@media (max-width: 600px) {
    .gallery-header h1 {
        font-size: 1.5rem;
    }

    .image-toggle-btn {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .new-badge {
        top: 15px;
        left: 15px;
        padding: 5px 10px;
        font-size: 0.7rem;
    }
}
