/**
 * Midas InstaFeed - Frontend Styles
 * Modern Instagram-style card design with hover effects
 */

/* Main Card Container */
.midas-instafeed-card {
    max-width: 500px;
    margin: 20px auto;
    background: #ffffff;
    border: 1px solid #dbdbdb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.midas-instafeed-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Card Style Variations */
.midas-instafeed-card-rounded {
    border-radius: 12px;
}

.midas-instafeed-card-square {
    border-radius: 0;
}

/* Header Section */
.midas-instafeed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #efefef;
}

.midas-instafeed-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.midas-instafeed-instagram-icon {
    width: 32px;
    height: 32px;
    color: #e4405f;
    flex-shrink: 0;
}

.midas-instafeed-username {
    font-weight: 600;
    font-size: 14px;
    color: #262626;
    text-decoration: none;
}

.midas-instafeed-timestamp {
    font-size: 12px;
    color: #8e8e8e;
    font-weight: 400;
}

/* Image Section */
.midas-instafeed-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #fafafa;
}

.midas-instafeed-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.midas-instafeed-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hover Zoom Effect */
.midas-instafeed-image-link:hover .midas-instafeed-image {
    transform: scale(1.05);
}

/* Image Overlay */
.midas-instafeed-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.midas-instafeed-image-link:hover .midas-instafeed-overlay {
    opacity: 1;
}

.midas-instafeed-overlay-icon {
    width: 48px;
    height: 48px;
    color: #ffffff;
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Caption Section */
.midas-instafeed-caption {
    padding: 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #262626;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.midas-instafeed-caption strong {
    font-weight: 600;
    margin-right: 6px;
}

/* Footer Section */
.midas-instafeed-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid #efefef;
}

/* View on Instagram Button */
.midas-instafeed-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(188, 24, 136, 0.3);
    width: 100%;
    text-align: center;
}

.midas-instafeed-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(188, 24, 136, 0.4);
    color: #ffffff;
    text-decoration: none;
}

.midas-instafeed-button:active {
    transform: translateY(0);
}

.midas-instafeed-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Error Message */
.midas-instafeed-error {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    text-align: center;
}

.midas-instafeed-error p {
    margin: 0;
    font-size: 14px;
}

/* Fallback State */
.midas-instafeed-fallback {
    opacity: 0.7;
}

/* Loading State */
.midas-instafeed-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    font-size: 14px;
    color: #8e8e8e;
}

.midas-instafeed-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    margin-left: 10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e4405f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Profile Card Styles */
.midas-instafeed-profile {
    max-width: 400px;
}

.midas-instafeed-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.midas-instafeed-profile-pic {
    flex-shrink: 0;
}

.midas-instafeed-profile-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #dbdbdb;
}

.midas-instafeed-profile-info {
    flex: 1;
}

.midas-instafeed-profile-username {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 4px;
}

.midas-instafeed-verified-badge {
    width: 16px;
    height: 16px;
    color: #0095f6;
}

.midas-instafeed-profile-fullname {
    font-size: 14px;
    color: #8e8e8e;
    font-weight: 400;
}

.midas-instafeed-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid #efefef;
    border-bottom: 1px solid #efefef;
}

.midas-instafeed-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    text-align: center;
    border-right: 1px solid #efefef;
}

.midas-instafeed-stat:last-child {
    border-right: none;
}

.midas-instafeed-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 4px;
}

.midas-instafeed-stat-label {
    font-size: 12px;
    color: #8e8e8e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.midas-instafeed-profile-bio {
    padding: 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #262626;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive Design */
@media (max-width: 768px) {
    .midas-instafeed-card {
        max-width: 100%;
        margin: 10px 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .midas-instafeed-card-rounded {
        border-radius: 0;
    }

    .midas-instafeed-header {
        padding: 12px;
    }

    .midas-instafeed-caption {
        padding: 12px;
        font-size: 13px;
    }

    .midas-instafeed-footer {
        padding: 10px 12px 12px;
    }

    .midas-instafeed-button {
        padding: 9px 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .midas-instafeed-instagram-icon {
        width: 28px;
        height: 28px;
    }

    .midas-instafeed-username {
        font-size: 13px;
    }

    .midas-instafeed-timestamp {
        font-size: 11px;
    }

    .midas-instafeed-overlay-icon {
        width: 40px;
        height: 40px;
    }

    .midas-instafeed-profile-image {
        width: 64px;
        height: 64px;
    }

    .midas-instafeed-profile-header {
        padding: 16px;
        gap: 12px;
    }

    .midas-instafeed-profile-username {
        font-size: 15px;
    }

    .midas-instafeed-stat {
        padding: 12px 8px;
    }

    .midas-instafeed-stat-value {
        font-size: 16px;
    }

    .midas-instafeed-stat-label {
        font-size: 11px;
    }

    .midas-instafeed-profile-bio {
        padding: 12px;
        font-size: 13px;
    }
}

/* Widget Specific Styles */
.widget .midas-instafeed-card {
    margin: 0;
}

.sidebar .midas-instafeed-card {
    max-width: 100%;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .midas-instafeed-card {
        background: #1a1a1a;
        border-color: #2a2a2a;
        color: #f5f5f5;
    }

    .midas-instafeed-header {
        border-bottom-color: #2a2a2a;
    }

    .midas-instafeed-username,
    .midas-instafeed-caption {
        color: #f5f5f5;
    }

    .midas-instafeed-timestamp {
        color: #a0a0a0;
    }

    .midas-instafeed-footer {
        border-top-color: #2a2a2a;
    }

    .midas-instafeed-image-wrapper {
        background: #2a2a2a;
    }
}

/* Accessibility */
.midas-instafeed-button:focus,
.midas-instafeed-image-link:focus {
    outline: 2px solid #0095f6;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .midas-instafeed-overlay,
    .midas-instafeed-button {
        display: none;
    }

    .midas-instafeed-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Animation for card entrance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.midas-instafeed-card {
    animation: fadeInUp 0.5s ease-out;
}

/* Hover effect for the entire card */
.midas-instafeed-card {
    position: relative;
}

.midas-instafeed-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(228, 64, 95, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.midas-instafeed-card:hover::before {
    opacity: 1;
}

/* Ensure content is above the gradient */
.midas-instafeed-card > * {
    position: relative;
    z-index: 2;
}
