/**
 * Instagram Wall Widget Styles
 */

/* ================================
   Main Wrapper
   ================================ */
.instagram-wall-widget,
.instagram-elementor-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.instagram-posts-wrapper,
.instagram-posts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ================================
   Post Card
   ================================ */
.instagram-post {
    background: #ffffff;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    padding: 16px;
    transition: box-shadow 0.2s ease;
}

.instagram-post:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.instagram-post-pinned {
    border-left: 3px solid #E1306C;
}

/* ================================
   Post Header - Author
   ================================ */
.instagram-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.instagram-post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.instagram-author-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #E1306C;
}

.instagram-author-name {
    font-weight: 600;
    font-size: 14px;
    color: #262626;
    text-decoration: none;
}

.instagram-author-name:hover {
    text-decoration: underline;
}

.instagram-post-author-text {
    font-weight: 600;
    font-size: 14px;
    color: #262626;
}

/* ================================
   Post Media (Images/Videos)
   ================================ */
.instagram-post-media {
    margin: 12px -16px;
    position: relative;
}

.instagram-post-image-wrapper {
    width: 100%;
    overflow: hidden;
}

.instagram-post-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.instagram-post:hover .instagram-post-image {
    transform: scale(1.02);
}

.instagram-post-media .instagram-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.instagram-more-photos {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* Video */
.instagram-post-video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    border-radius: 4px;
}

.instagram-post-video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instagram-video-icon {
    font-size: 48px;
    opacity: 0.8;
}

.instagram-video-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ================================
   Post Text
   ================================ */
.instagram-post-text {
    font-size: 14px;
    line-height: 1.5;
    color: #262626;
    margin: 12px 0;
    word-wrap: break-word;
}

.instagram-post-text a {
    color: #00376b;
    text-decoration: none;
}

.instagram-post-text a:hover {
    text-decoration: underline;
}

/* ================================
   Post Date
   ================================ */
.instagram-post-date {
    display: block;
    font-size: 12px;
    color: #8e8e8e;
    margin: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================
   Post Stats (Likes, Comments)
   ================================ */
.instagram-post-stats {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    border-top: 1px solid #efefef;
    margin-top: 8px;
}

.instagram-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #262626;
}

.instagram-stat-icon {
    font-size: 16px;
}

.instagram-stat-count {
    font-weight: 500;
}

/* ================================
   Post Link Button
   ================================ */
.instagram-post-link {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    background: linear-gradient(45deg, #E1306C, #C13584);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.instagram-post-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(225, 48, 108, 0.4);
    text-decoration: none;
}

/* ================================
   More Posts Link
   ================================ */
.instagram-more {
    margin-top: 20px;
    text-align: center;
}

.instagram-more a {
    display: inline-block;
    padding: 10px 20px;
    background: #fafafa;
    color: #262626;
    text-decoration: none;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.instagram-more a:hover {
    background: #efefef;
    text-decoration: none;
}

/* ================================
   Error & Placeholder States
   ================================ */
.instagram-widget-error,
.instagram-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 12px;
    color: #721c24;
}

.instagram-widget-placeholder,
.instagram-elementor-placeholder {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px;
    color: #856404;
}

.instagram-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #8e8e8e;
    font-size: 14px;
}

/* ================================
   Responsive Adjustments
   ================================ */
@media (max-width: 768px) {
    .instagram-post {
        padding: 12px;
    }

    .instagram-post-media {
        margin: 12px -12px;
    }

    .instagram-author-photo {
        width: 36px;
        height: 36px;
    }

    .instagram-author-name {
        font-size: 13px;
    }

    .instagram-post-text {
        font-size: 13px;
    }

    .instagram-post-stats {
        gap: 12px;
    }

    .instagram-stat {
        font-size: 13px;
    }
}

/* ================================
   Elementor Specific Styles
   ================================ */
.instagram-elementor-title {
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

/* ================================
   WordPress Widget Specific Styles
   ================================ */
.widget_instagram_wall_widget .instagram-posts-wrapper {
    gap: 16px;
}

.widget_instagram_wall_widget .instagram-post {
    margin-bottom: 0;
}

/* ================================
   Loading Animation
   ================================ */
@keyframes instagram-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.instagram-loading {
    animation: instagram-pulse 1.5s ease-in-out infinite;
}

/* ================================
   Dark Mode Support
   ================================ */
@media (prefers-color-scheme: dark) {
    .instagram-post {
        background: #1a1a1a;
        border-color: #363636;
    }

    .instagram-author-name,
    .instagram-post-text,
    .instagram-stat {
        color: #e0e0e0;
    }

    .instagram-post-date {
        color: #8e8e8e;
    }

    .instagram-post-stats {
        border-top-color: #363636;
    }

    .instagram-more a {
        background: #2a2a2a;
        border-color: #363636;
        color: #e0e0e0;
    }

    .instagram-more a:hover {
        background: #363636;
    }
}
