/* Instagram Mockups Design System */

/* --- SHARED & THEME COLORS --- */
.mockup-light {
    --ig-bg: #ffffff;
    --ig-text: #000000;
    --ig-text-dim: #8e8e8e;
    --ig-border: #efefef;
    --ig-link: #00376b;
    --ig-btn-bg: #efefef;
}

.mockup-dark {
    --ig-bg: #000000;
    --ig-text: #f5f5f5;
    --ig-text-dim: #a8a8a8;
    --ig-border: #262626;
    --ig-link: #e0f1ff;
    --ig-btn-bg: #262626;
}

.text-main {
    color: var(--ig-text) !important;
}

.text-dim {
    color: var(--ig-text-dim) !important;
}

.highlight-link {
    color: var(--ig-link) !important;
    font-weight: 400;
}

/* --- POST MOCKUP --- */
.ig-preview-canvas {
    background: var(--ig-bg);
    color: var(--ig-text);
    border: 1px solid var(--ig-border);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#display-media-wrapper {
    aspect-ratio: 1/1;
    background: var(--ig-border);
}

.story-ring {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 2.5px;
    /* Space for the ring */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.story-ring img {
    border-radius: 50%;
    width: 38px;
    height: 38px;
    object-fit: cover;
    z-index: 2;
    /* Keep image on top */
}

/* Base ring is transparent until status is applied */
.story-ring.status-none {
    padding: 0;
}

.story-ring.status-none img {
    width: 32px;
    height: 32px;
    border: none;
}

.story-ring:not(.status-none) img {
    border: 2px solid var(--ig-bg);
}

#display-follow {
    color: #0095F6;
}

.story-ring.status-public {
    background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
}

.story-ring.status-private {
    background: #45bd62;
}

.story-ring.status-none {
    background: transparent;
    padding: 0;
}

.story-ring.status-none img {
    border: none;
}

/* --- STORY MOCKUP --- */
#story-canvas {
    width: 430px;
    height: 764px;
    /* Native 9:16 aspect */
    background: #000;
    position: relative;
    overflow: hidden;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.story-shadow-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
    z-index: 10;
}

.story-progress-track {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 100;
}

.story-progress-bar {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.story-progress-bar span {
    display: block;
    height: 100%;
    background: #fff;
    width: 0;
}

.story-progress-bar.past span {
    width: 100%;
}

.story-progress-bar.active span {
    width: 40%;
}

/* Static for preview */

.story-main-header {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
}

.story-avatar-container {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

.story-avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.story-user-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.story-username-text {
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.story-verified-svg {
    width: 12px;
    height: 12px;
}

.story-time-text {
    font-size: 14px;
    opacity: 0.8;
}

.story-music-attribution {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    margin-top: 1px;
}

.music-wave {
    display: flex;
    align-items: center;
    gap: 2.5px;
    height: 14px;
    width: 14px;
    flex-shrink: 0;
}

.music-wave span {
    width: 2.5px;
    background: white;
    border-radius: 10px;
    animation: music-wave-anim 0.8s ease-in-out infinite;
    transform-origin: center;
}

.music-wave span:nth-child(1) {
    height: 12px;
    animation-delay: 0.0s;
}

.music-wave span:nth-child(2) {
    height: 6px;
    animation-delay: 0.3s;
}

.music-wave span:nth-child(3) {
    height: 9px;
    animation-delay: 0.1s;
}

@keyframes music-wave-anim {

    0%,
    100% {
        transform: scaleY(0.5);
    }

    50% {
        transform: scaleY(1.1);
    }
}

.story-media-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 84px;
    z-index: 5;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.story-media-placeholder {
    opacity: 0.5;
}

/* --- PROFILE MOCKUP --- */
.ig-profile-canvas {
    width: 430px;
    min-height: 932px;
    background: white;
    display: flex;
    flex-direction: column;
    color: #000;
}

.profile-action-bar {
    height: 53.75px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.ig-btn-primary {
    background-color: #0095F6 !important;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 8px;
    height: 30.5px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    border: none;
    width: 100%;
}

.ig-btn-secondary {
    background-color: var(--ig-btn-bg) !important;
    color: var(--ig-text) !important;
    font-weight: 600;
    border-radius: 8px;
    height: 30.5px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    border: none;
    width: 100%;
}

.tab-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    position: relative;
    cursor: pointer;
    color: #8e8e8e;
    transition: color 0.2s;
}

.tab-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    transition: width 0.3s ease;
}

.active.tab-item {
    color: var(--ig-text);
}

.active.tab-item::after {
    width: 45px;
    background: var(--ig-text);
}

.highlight-ring {
    width: 71.1px;
    height: 71.1px;
    border: 1px solid var(--ig-border);
    padding: 5.5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.highlight-item {
    width: 87.8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 99.1px;
}

.highlight-text {
    width: 100%;
    text-align: center;
    font-size: 11.5px;
    color: var(--ig-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 6px;
    font-weight: 500;
    display: block;
}

.border-divider {
    border-color: var(--ig-border) !important;
}

/* --- DARK MODE OVERRIDES --- */
.mockup-dark .ig-profile-canvas,
.mockup-dark .ig-preview-canvas {
    background: #000 !important;
}

.mockup-dark .story-ring img {
    border-color: #000 !important;
}

.story-footer-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 84px;
    padding: 0 12px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.mockup-light .story-footer-layer {
    background: #ffffff;
    color: #000000;
}

.mockup-dark .story-footer-layer {
    background: #000000;
    color: #ffffff;
}

.mockup-light .story-msg-container {
    border-color: #dbdbdb;
}

.mockup-dark .story-msg-container {
    border-color: rgba(255, 255, 255, 0.5);
}

.story-msg-container {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 500;
}

.story-action-btn {
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.story-action-btn:hover {
    opacity: 1;
}