/* 
   Ultra - Pinterest Deep Theme
*/

:root {
    --pin-red: #e60023;
    --pin-gray: #efefef;
    --pin-black: #111111;
    --pin-hover: #e2e2e2;
    --text-primary: #111111;
    --text-secondary: #767676;
    --bg-white: #ffffff;
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background-color: var(--bg-white);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* --- Ultra Brand Navbar (Custom Sync) --- */
.ultra-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid #e2e8f0;
    height: 64px;
    display: flex;
    align-items: center;
}

.navbar-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    text-decoration: none;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: -0.025em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #2563eb;
}

.cta-button {
    background: #2563eb;
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.cta-button:hover {
    background: #1d4ed8;
}

/* --- Sub-navigation / Filter Wrapper --- */
.filter-wrapper {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    z-index: 999;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.tags-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.filter-btn {
    padding: 8px 18px;
    border-radius: 999px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #e2e8f0;
}

.filter-btn.active {
    background: #1e293b;
    color: white;
}

/* Main Grid */
.main-content {
    padding: 8px 16px 40px;
}

.masonry-grid {
    column-count: 5;
    column-gap: 16px;
}

.grid-item {
    break-inside: avoid;
    margin-bottom: 16px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: zoom-in;
    background: var(--pin-gray);
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.3s;
}

.grid-item:hover img {
    filter: brightness(0.8);
}

.item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    background: rgba(0,0,0,0.1);
    transition: opacity 0.3s;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.grid-item:hover .item-overlay {
    opacity: 1;
}

.save-btn {
    background: var(--pin-red);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    align-self: flex-end;
}

.save-btn:hover {
    background: #ad001b;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.lightbox.active {
    display: flex;
}

.lightbox-card {
    background: white;
    border-radius: 32px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
}

.lightbox-img-container {
    flex: 1.5;
    background: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-img-container img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-info {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.save-btn.large {
    width: 100%;
    font-size: 18px;
    padding: 16px;
}

/* Animations */
.grid-item {
    animation: fadeIn 0.6s ease-out backwards;
}

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

/* Responsive */
@media (max-width: 1600px) { .masonry-grid { column-count: 5; } }
@media (max-width: 1200px) { .masonry-grid { column-count: 4; } }
@media (max-width: 900px)  { .masonry-grid { column-count: 3; } }
@media (max-width: 600px)  { 
    .masonry-grid { column-count: 2; }
    .pin-header { padding: 4px 8px; }
    .logo { width: 36px; height: 36px; font-size: 18px; }
    .main-nav, .icon-group { display: none; }
}
@media (max-width: 400px)  { .masonry-grid { column-count: 1; } }
