/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #fafafa;
    color: #262626;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar {
    background: #fff;
    border-bottom: 1px solid #dbdbdb;
    padding: 15px 20px;
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 935px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Grand Hotel', cursive;
    font-size: 32px;
    font-weight: 500;
}

/* Buttons */
.upload-btn {
    background: #0095f6;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.upload-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Container */
.container {
    max-width: 935px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 40px;
}

.gallery-item {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    cursor: pointer;
    overflow: hidden;
    background: #efefef;
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    color: white;
    font-weight: 600;
}

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

/* Feed View */
.feed-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 2000;
    overflow-y: auto;
    padding-top: 60px;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling iOS */
}

.feed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #dbdbdb;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 2010;
}

.feed-close-btn {
    font-size: 24px;
    cursor: pointer;
    color: #262626;
    padding: 10px;
    /* Touch target */
}

.feed-item {
    margin-bottom: 20px;
    border-bottom: 1px solid #efefef;
    padding-bottom: 20px;
    background: #fff;
}

.feed-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 80vh;
    object-fit: contain;
    background: #fafafa;
}

/* Feed Actions - RESET display to block for vertical stacking */
.feed-actions {
    padding: 10px 15px;
    display: block;
    /* Vertical stacking of rows */
}

/* Default Feed Icons */
/* Default Feed Icons */
.feed-actions i {
    font-size: 24px;
    /* margin-right controlled by flex gaps now */
    padding: 5px;
    cursor: pointer;
}

.feed-tags {
    padding: 0 15px;
}

/* Filter/Tag Bars */
.filter-bar,
.tags-filter {
    display: flex;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 20px;
    gap: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-bar::-webkit-scrollbar,
.tags-filter::-webkit-scrollbar {
    display: none;
}

.filter-chip,
.tag-pill {
    flex: 0 0 auto;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #dbdbdb;
    border-radius: 20px;
    font-size: 15px;
    color: #262626;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.filter-chip.active,
.tag-pill.active {
    background: #262626;
    color: #fff;
    border-color: #262626;
}

/* ----- MOBILE OPTIMIZATIONS ----- */
@media (max-width: 736px) {

    /* Navbar Scaling - Moderate */
    .navbar {
        padding: 12px 15px;
    }

    .logo {
        font-size: 28px;
    }

    .upload-btn {
        padding: 8px 16px;
        font-size: 15px;
    }

    /* Grid to Feed Conversion */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 images per row */
        gap: 3px;
    }

    .container {
        padding: 0;
    }

    .gallery-item {
        margin-bottom: 5px;
        border-radius: 0;
    }

    /* Feed View Scaling */
    .feed-header {
        height: 50px;
        /* Reduced from 70px */
        font-size: 18px;
    }

    .feed-view {
        padding-top: 50px;
    }

    .feed-close-btn {
        font-size: 24px;
        padding: 12px;
    }

    /* Icons - Balanced */
    .feed-actions {
        padding: 10px 15px;
    }

    .feed-actions i {
        font-size: 28px !important;
        /* Touch friendly but not huge */
        /* margin-right controlled by flex gaps now */
    }

    /* Touch Friendly Comments */
    .comments-list {
        font-size: 14px !important;
        line-height: 1.4;
    }

    /* Inputs */
    input,
    textarea {
        font-size: 16px !important;
        /* Prevent iOS zoom */
    }

    /* Comment Input Area */
    form[style*="padding: 0 15px;"] {
        padding: 8px 15px !important;
    }

    /* Make input standard size */
    input[placeholder="Add a comment..."] {
        padding: 10px 0 !important;
        height: auto;
    }

    /* Tag pills */
    .tag-pill,
    .filter-chip {
        padding: 8px 16px;
        font-size: 14px;
    }
}