/* Instagram Tool Dedicated Styles */

/* Base Layout Modifications */
.main-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    margin-top: 40px;
    margin-bottom: 64px;
    align-items: start;
}

.page-title-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-subtitle {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-primary);
    letter-spacing: 1.5px;
    margin-bottom: 2px;
}

.page-title {
    font-family: var(--font-brand);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Left Column: Mockup Area */
.mockup-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.mockup-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    color: var(--text-secondary);
    padding: 0 4px;
}

.mock-badge {
    font-weight: 600;
    color: var(--color-primary);
    background: rgba(0, 230, 118, 0.08);
    padding: 4px 10px;
    border-radius: 12px;
}

.mock-device-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* High Fidelity Instagram Feed Card */
.instagram-card {
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-color);
    background: #000000; /* Pure Instagram Dark Mode default */
}

/* Theming Instagram Card based on ReUse global theme */
[data-theme="dark"] .instagram-card {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .instagram-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

/* Card Header */
.ig-card-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    position: relative;
}

.ig-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f09433, #bc1888); /* IG Gradient */
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    border: 2px solid transparent;
}

.ig-user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ig-username-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ig-username {
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

[data-theme="dark"] .ig-username {
    color: #f5f5f5;
}

[data-theme="light"] .ig-username {
    color: #262626;
}

.ig-username:hover {
    opacity: 0.85;
}

.ig-verified-badge {
    display: flex;
    align-items: center;
}

.ig-location {
    font-size: 11px;
}

[data-theme="dark"] .ig-location {
    color: #a8a8a8;
}

[data-theme="light"] .ig-location {
    color: #737373;
}

.ig-more-options {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

[data-theme="dark"] .ig-more-options {
    color: #f5f5f5;
}

[data-theme="light"] .ig-more-options {
    color: #262626;
}

/* Instagram Image Carousel */
.ig-carousel-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #121212;
    overflow: hidden;
}

[data-theme="light"] .ig-carousel-container {
    background-color: #fafafa;
}

.ig-carousel-track {
    display: flex;
    width: 300%; /* 3 images */
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.ig-carousel-slide {
    width: 33.333%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

/* Navigation Arrows */
.ig-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    color: #121212;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    z-index: 10;
    transition: opacity 0.2s, background 0.2s;
}

.ig-nav-btn:hover {
    background: #ffffff;
}

.ig-nav-prev {
    left: 12px;
}

.ig-nav-next {
    right: 12px;
}

/* Heart Popup Animation (Double Tap) */
.ig-heart-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 12;
    opacity: 0;
    filter: drop-shadow(0 0 15px rgba(0,0,0,0.5));
}

.ig-heart-overlay.animate {
    animation: heart-pop 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes heart-pop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    15% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.9; }
    30% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* Instagram Actions Bar */
.ig-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 8px 16px;
    position: relative;
}

.ig-left-actions {
    display: flex;
    gap: 16px;
}

.ig-action-icon-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .ig-action-icon-btn {
    color: #f5f5f5;
}

[data-theme="light"] .ig-action-icon-btn {
    color: #262626;
}

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

.ig-action-icon-btn:active {
    transform: scale(0.9);
}

/* Pagination Dots */
.ig-carousel-dots {
    display: flex;
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.ig-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: background 0.3s;
}

[data-theme="dark"] .ig-dot {
    background: #555555;
}

[data-theme="dark"] .ig-dot.active {
    background: #0095f6; /* IG Blue active dot */
}

[data-theme="light"] .ig-dot {
    background: #cccccc;
}

[data-theme="light"] .ig-dot.active {
    background: #0095f6;
}

/* Likes Area */
.ig-likes-area {
    padding: 0 16px;
    font-size: 13.5px;
    margin-bottom: 6px;
}

[data-theme="dark"] .ig-likes-area {
    color: #f5f5f5;
}

[data-theme="light"] .ig-likes-area {
    color: #262626;
}

.ig-likes-area strong {
    font-weight: 600;
    cursor: pointer;
}

.ig-likes-area strong:hover {
    opacity: 0.8;
}

/* Caption Area */
.ig-caption-area {
    padding: 0 16px;
    font-size: 13.5px;
    line-height: 1.45;
    margin-bottom: 8px;
    position: relative;
}

.ig-caption-paragraph {
    display: inline;
}

.ig-caption-paragraph .ig-username {
    margin-right: 6px;
}

.ig-caption-text {
    white-space: pre-wrap;
}

[data-theme="dark"] .ig-caption-text {
    color: #f5f5f5;
}

[data-theme="light"] .ig-caption-text {
    color: #262626;
}

.ig-more-caption {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-left: 4px;
}

[data-theme="dark"] .ig-more-caption {
    color: #a8a8a8;
}

[data-theme="light"] .ig-more-caption {
    color: #737373;
}

/* Comments List area */
.ig-comments-area {
    padding: 0 16px 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    max-height: 110px;
    overflow-y: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .ig-comments-area {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

/* Scrollbar for comments */
.ig-comments-area::-webkit-scrollbar {
    width: 4px;
}
.ig-comments-area::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.ig-comment {
    line-height: 1.4;
    animation: fade-in-comment 0.3s ease-out forwards;
}

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

.ig-comment .ig-username {
    font-size: 13px;
    margin-right: 6px;
}

[data-theme="dark"] .ig-comment-text {
    color: #e5e5e5;
}

[data-theme="light"] .ig-comment-text {
    color: #363636;
}

/* Time & Translation */
.ig-post-time {
    padding: 6px 16px 14px 16px;
    font-size: 10px;
    letter-spacing: 0.2px;
}

[data-theme="dark"] .ig-post-time {
    color: #a8a8a8;
}

[data-theme="light"] .ig-post-time {
    color: #737373;
}

/* Add Comment Input block */
.ig-add-comment-box {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13.5px;
}

[data-theme="light"] .ig-add-comment-box {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.ig-comment-emoji-icon {
    font-size: 18px;
    margin-right: 12px;
    cursor: pointer;
    user-select: none;
}

.ig-add-comment-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 13.5px;
}

[data-theme="dark"] .ig-add-comment-box input {
    color: #ffffff;
}

[data-theme="dark"] .ig-add-comment-box input::placeholder {
    color: #a8a8a8;
}

[data-theme="light"] .ig-add-comment-box input {
    color: #262626;
}

[data-theme="light"] .ig-add-comment-box input::placeholder {
    color: #737373;
}

.ig-add-comment-box button {
    background: none;
    border: none;
    font-weight: 600;
    color: #0095f6;
    cursor: pointer;
    padding: 4px 0 4px 8px;
    transition: opacity 0.2s;
}

.ig-add-comment-box button:disabled {
    opacity: 0.3;
    cursor: default;
}

/* RIGHT COLUMN: CONTROL PANEL */
.control-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.control-panel {
    padding: 32px;
    border-radius: var(--radius-md);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.panel-icon {
    font-size: 28px;
}

.panel-subtitle {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Tabs */
.panel-tabs {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .panel-tabs {
    background: rgba(0, 0, 0, 0.04);
}

.panel-tab-btn {
    flex: 1;
    font-family: var(--font-brand);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.panel-tab-btn:hover {
    color: var(--text-primary);
}

.panel-tab-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .panel-tab-btn.active {
    background: #ffffff;
    color: var(--color-primary-hover);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Panel Contents visibility */
.panel-content {
    display: none;
    animation: fade-in-panel 0.35s ease;
}

.panel-content.active {
    display: block;
}

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

/* Custom Input / Textarea Editor */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.char-counter {
    font-size: 11px;
    color: var(--text-muted);
}

.custom-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 13px;
    line-height: 1.5;
    padding: 16px;
    outline: none;
    resize: vertical;
    transition: var(--transition-smooth);
    margin-bottom: 20px;
}

[data-theme="light"] .custom-textarea {
    background: rgba(255, 255, 255, 0.6);
}

.custom-textarea:focus {
    border-color: var(--color-primary);
    background: rgba(0, 0, 0, 0.25);
    box-shadow: 0 0 12px var(--color-primary-glow);
}

[data-theme="light"] .custom-textarea:focus {
    background: #ffffff;
}

/* Hashtag Section styling */
.hashtag-section {
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.custom-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 12px;
    padding: 10px 14px;
    outline: none;
    transition: var(--transition-smooth);
    margin-bottom: 12px;
}

[data-theme="light"] .custom-input {
    background: rgba(255, 255, 255, 0.6);
}

.custom-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
}

.btn-full {
    width: 100%;
}

.action-row {
    display: flex;
    gap: 12px;
}

/* Media Cards / Formatting (Tab 2) */
.media-help-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 20px;
}

.media-grid-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.media-item-card {
    display: flex;
    gap: 16px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: rgba(16, 19, 24, 0.4);
    border-color: var(--border-color);
}

.media-item-thumb {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item-details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.media-item-details h4 {
    font-family: var(--font-brand);
    font-size: 14px;
    font-weight: 600;
}

.media-item-details p {
    font-size: 11.5px;
    color: var(--text-muted);
}

.media-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-media-action {
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-brand);
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-copy {
    background: var(--color-primary);
    color: #000;
}

.btn-copy:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.btn-download {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-download:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

/* Responsiveness adjustments */
@media (max-width: 968px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    
    .mockup-column {
        max-width: 450px;
    }
}

/* Instagram Shopping Price Tag Overlay */
.ig-shopping-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 5;
    cursor: pointer;
    width: 40%;
    animation: tag-fade-in 0.8s ease-out;
}

@keyframes tag-fade-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.ig-tag-dot {
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.ig-tag-dot::after {
    content: '';
    width: 7px;
    height: 7px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
    animation: tag-pulse 2s infinite;
}

@keyframes tag-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.ig-tag-bubble {
    background: rgba(18, 18, 18, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease;
    user-select: none;
    pointer-events: auto;
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.ig-tag-bubble::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(18, 18, 18, 0.92) transparent;
}

.ig-tag-product-name {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

.ig-tag-price {
    color: #00e676; /* Accent green for the price */
    font-weight: 700;
}

/* Clicking photo toggles tag bubble visibility */
.ig-shopping-tag.hidden .ig-tag-bubble {
    opacity: 0;
    transform: scale(0.8) translateY(-5px);
    pointer-events: none;
}
