/* Instagram Posts Plugin Frontend Styles */

.instagram-posts-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.instagram-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
}

.instagram-no-posts {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}

/* Grid Layout */
.instagram-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .instagram-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .instagram-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
}

/* Carousel Layout */
.instagram-carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 20px;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.instagram-carousel::-webkit-scrollbar {
    height: 8px;
}

.instagram-carousel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.instagram-carousel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.instagram-carousel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.instagram-carousel .instagram-post {
    flex: 0 0 300px;
    min-width: 300px;
}

@media (max-width: 768px) {
    .instagram-carousel .instagram-post {
        flex: 0 0 250px;
        min-width: 250px;
    }
}

/* Individual Post */
.instagram-post {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.instagram-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.instagram-media-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

.instagram-media-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.instagram-media-container:hover img {
    transform: scale(1.05);
}

.instagram-video-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
}

.instagram-video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    padding: 12px;
    transition: background 0.3s ease;
}

.instagram-video-indicator:hover {
    background: rgba(0, 0, 0, 0.8);
}

.instagram-video-indicator svg {
    display: block;
    width: 24px;
    height: 24px;
}

.instagram-post-info {
    padding: 15px;
}

.instagram-caption {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 8px;
}

.instagram-date {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.instagram-attribution {
    text-align: center;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.instagram-attribution a {
    color: #E4405F;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

.instagram-attribution a:hover {
    color: #c13584;
    text-decoration: underline;
}

/* Loading states */
.instagram-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: #666;
}

.instagram-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #E4405F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .instagram-grid {
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .instagram-posts-container {
        margin: 15px 0;
    }
    
    .instagram-post-info {
        padding: 12px;
    }
    
    .instagram-caption {
        font-size: 13px;
    }
    
    .instagram-date {
        font-size: 11px;
    }
}

/* Accessibility improvements */
.instagram-post a:focus {
    outline: 2px solid #E4405F;
    outline-offset: 2px;
}

.instagram-video-indicator {
    cursor: pointer;
}

/* Animation for smooth loading */
.instagram-post {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.instagram-post:nth-child(1) { animation-delay: 0.1s; }
.instagram-post:nth-child(2) { animation-delay: 0.2s; }
.instagram-post:nth-child(3) { animation-delay: 0.3s; }
.instagram-post:nth-child(4) { animation-delay: 0.4s; }
.instagram-post:nth-child(5) { animation-delay: 0.5s; }
.instagram-post:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}