/* ============================================================
   INSTAGRAM STYLE DESIGN - Gallery Platform
   ============================================================ */

:root {
    --primary-color: #c50025;
    --primary-dark: #a00020;
    --secondary-color: #f77737;
    --text-dark: #262626;
    --text-light: #999;
    --border-light: #efefef;
    --bg-light: #fafafa;
}

/* ============================================================
   FEED LAYOUT - INSTAGRAM STYLE GRID
   ============================================================ */

.ig-feed {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 12px !important;
    padding: 20px 0 !important;
}

.ig-feed > * {
    display: block !important;
}

@media (min-width: 640px) {
    .ig-feed {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

@media (min-width: 768px) {
    .ig-feed {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px !important;
    }
}

@media (min-width: 1024px) {
    .ig-feed {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
    }
}

.instagram-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 20px 0;
}

/* ============================================================
   POST CARD STYLING
   ============================================================ */

.ig-post-card {
    display: block !important;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.dark .ig-post-card {
    background: #262626;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ig-post-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.dark .ig-post-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   POST IMAGE CONTAINER
   ============================================================ */

.ig-post-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: block !important;
}

.ig-post-image-container img {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block !important;
}

.ig-post-card:hover .ig-post-image-container img {
    transform: scale(1.05);
}

/* ============================================================
   POST OVERLAY (HOVER STATE)
   ============================================================ */

.ig-post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.ig-post-card:hover .ig-post-overlay {
    opacity: 1;
}

.ig-overlay-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.ig-overlay-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.ig-overlay-action:hover {
    transform: scale(1.1);
}

.ig-overlay-action svg {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    fill: currentColor;
}

.ig-overlay-action-count {
    font-size: 14px;
    font-weight: 600;
}

/* ============================================================
   POST HEADER (MODEL INFO)
   ============================================================ */

.ig-post-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
}

.dark .ig-post-header {
    border-bottom-color: #363636;
}

.ig-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.ig-user-info {
    flex: 1;
}

.ig-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.dark .ig-user-name {
    color: #e4e4e4;
}

.ig-user-name:hover {
    color: var(--primary-color);
}

.ig-user-location {
    font-size: 12px;
    color: var(--text-light);
    margin: 2px 0 0 0;
}

/* ============================================================
   POST BODY
   ============================================================ */

.ig-post-body {
    padding: 16px;
}

.ig-post-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark .ig-post-title {
    color: #e4e4e4;
}

/* ============================================================
   POST STATS
   ============================================================ */

.ig-post-stats {
    display: flex;
    gap: 16px;
    padding: 8px 16px 12px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-light);
}

.dark .ig-post-stats {
    border-top-color: #363636;
    color: #a8a8a8;
}

.ig-stat-item {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    transition: color 0.2s ease;
    cursor: pointer;
}

.ig-stat-item:hover {
    color: var(--primary-color);
}

.ig-stat-count {
    font-weight: 600;
    display: block;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.dark .ig-stat-count {
    color: #e4e4e4;
}

/* ============================================================
   GALLERY HERO SECTION
   ============================================================ */

.ig-gallery-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 16px;
    color: white;
}

.ig-gallery-hero h1 {
    font-size: 2.5rem;
    margin: 0 0 12px 0;
    font-weight: 700;
}

.ig-gallery-hero p {
    font-size: 16px;
    margin: 0;
    opacity: 0.95;
}

/* ============================================================
   MASONRY ALTERNATIVE - Instagram 3 Column
   ============================================================ */

.ig-masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 20px 0;
}

@media (min-width: 768px) {
    .ig-masonry-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .ig-masonry-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* ============================================================
   BADGES & LABELS
   ============================================================ */

.ig-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ig-badge-primary {
    background: var(--primary-color);
    color: white;
}

.ig-badge-secondary {
    background: var(--secondary-color);
    color: white;
}

.ig-badge-featured {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

/* ============================================================
   LOADING STATE
   ============================================================ */

.ig-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 2s infinite;
}

.dark .ig-skeleton {
    background: linear-gradient(90deg, #363636 25%, #2a2a2a 50%, #363636 75%);
    background-size: 200% 100%;
}

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

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 640px) {
    .ig-post-card {
        border-radius: 6px;
    }

    .ig-gallery-hero {
        padding: 40px 16px;
        margin-bottom: 24px;
    }

    .ig-gallery-hero h1 {
        font-size: 1.75rem;
    }

    .ig-feed,
    .ig-masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .ig-overlay-action svg {
        width: 28px;
        height: 28px;
    }

    .ig-overlay-actions {
        gap: 16px;
    }
}

/* ============================================================
   DARK MODE ADJUSTMENTS
   ============================================================ */

.dark {
    --text-dark: #e4e4e4;
    --text-light: #a8a8a8;
    --border-light: #363636;
    --bg-light: #121212;
}

/* ============================================================
   ANIMATION & TRANSITIONS
   ============================================================ */

.ig-fade-in {
    animation: ig-fade-in 0.5s ease;
}

@keyframes ig-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   INTERACTION STATES
   ============================================================ */

.ig-post-card.liked {
    animation: ig-like-animation 0.4s ease;
}

@keyframes ig-like-animation {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================================
   STORY CIRCLE (MODEL PROFILE)
   ============================================================ */

.ig-story-ring {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    background: white;
    padding: 3px;
    background-clip: padding-box;
}

.ig-story-ring::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    z-index: -1;
}

.ig-story-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
