/* ============================================
   FGB Studio - Share Modal Styles
   ============================================ */

/* ---- Modal Overlay ---- */
.share-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

    .share-modal.show {
        display: flex;
        opacity: 1;
    }

/* ---- Modal Content ---- */
.share-modal-content {
    background: var(--fgb-surface, #fff);
    border-radius: 16px;
    width: 100%;
    max-width: 920px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--fgb-border, rgba(0, 0, 0, 0.08));
    display: flex;
    flex-direction: column;
}

[data-bs-theme="dark"] .share-modal-content {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.06);
}

/* ---- Header ---- */
.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--fgb-border, rgba(0, 0, 0, 0.08));
}

    .share-modal-header h2 {
        font-size: 1.15rem;
        font-weight: 700;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .share-modal-header h2 i {
            color: var(--fgb-accent, #10b981);
            font-size: 1rem;
        }

.share-modal-close {
    background: none;
    border: none;
    color: var(--fgb-text-secondary, #6b7280);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1;
}

    .share-modal-close:hover {
        background: var(--fgb-hover, rgba(0, 0, 0, 0.05));
        color: var(--fgb-text-primary, #111);
    }

[data-bs-theme="dark"] .share-modal-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* ---- Controls Area ---- */
.share-controls {
    padding: 16px 24px;
    border-bottom: 1px solid var(--fgb-border, rgba(0, 0, 0, 0.08));
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---- Design Picker ---- */
.share-design-picker {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.share-design-thumb {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 2px solid var(--fgb-border, rgba(0, 0, 0, 0.08));
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 110px;
}

    .share-design-thumb:hover {
        border-color: var(--fgb-accent, #10b981);
        background: rgba(16, 185, 129, 0.03);
    }

    .share-design-thumb.active {
        border-color: var(--fgb-accent, #10b981);
        background: rgba(16, 185, 129, 0.06);
    }

[data-bs-theme="dark"] .share-design-thumb {
    border-color: rgba(255, 255, 255, 0.08);
}

    [data-bs-theme="dark"] .share-design-thumb:hover,
    [data-bs-theme="dark"] .share-design-thumb.active {
        border-color: #10b981;
        background: rgba(16, 185, 129, 0.08);
    }

.share-design-preview-box {
    width: 80px;
    height: 45px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0d1525, #0a1020);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.15);
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

    .share-design-preview-box.square {
        width: 45px;
        height: 45px;
    }

.share-design-thumb.active .share-design-preview-box {
    border-color: rgba(16, 185, 129, 0.3);
    color: rgba(16, 185, 129, 0.3);
}

.share-design-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fgb-text-primary, #111);
}

[data-bs-theme="dark"] .share-design-name {
    color: #e5e7eb;
}

.share-design-thumb.active .share-design-name {
    color: var(--fgb-accent, #10b981);
}

.share-design-desc {
    font-size: 0.65rem;
    color: var(--fgb-text-secondary, #6b7280);
    text-align: center;
    line-height: 1.3;
}

/* ---- Options Row ---- */
.share-options {
    display: flex;
    align-items: center;
    gap: 24px;
}

.share-option-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-option-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fgb-text-secondary, #6b7280);
    white-space: nowrap;
    margin: 0;
}

/* Theme toggle */
.share-theme-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--fgb-border, rgba(0, 0, 0, 0.1));
}

.share-theme-btn {
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--fgb-text-secondary, #6b7280);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .share-theme-btn i {
        font-size: 0.7rem;
    }

    .share-theme-btn:first-child {
        border-right: 1px solid var(--fgb-border, rgba(0, 0, 0, 0.1));
    }

    .share-theme-btn.active {
        background: var(--fgb-accent, #10b981);
        color: #fff;
    }

    .share-theme-btn:not(.active):hover {
        background: var(--fgb-hover, rgba(0, 0, 0, 0.04));
    }

[data-bs-theme="dark"] .share-theme-toggle {
    border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .share-theme-btn:first-child {
    border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .share-theme-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Ratings toggle switch */
.share-option-group .form-check {
    padding: 0;
    margin: 0;
}

.share-option-group .form-check-input {
    margin: 0;
    cursor: pointer;
}

/* ---- Preview Area ---- */
.share-preview-area {
    padding: 20px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--fgb-bg-secondary, #f3f4f6);
    min-height: 380px;
}

[data-bs-theme="dark"] .share-preview-area {
    background: #0a0f1a;
}

#sharePreviewCanvas {
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 460px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ---- Actions ---- */
.share-actions {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--fgb-border, rgba(0, 0, 0, 0.08));
}

.share-copy-btn {
    background: var(--fgb-accent, #10b981) !important;
    border-color: var(--fgb-accent, #10b981) !important;
    color: #fff !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 8px;
    transition: all 0.2s;
}

    .share-copy-btn:hover {
        background: #059669 !important;
        border-color: #059669 !important;
    }

    .share-copy-btn:disabled {
        opacity: 0.6;
    }

#shareDownloadBtn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
}

/* ---- Toolbar Share Button ---- */
.btn-toolbar-share {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--fgb-border, rgba(0, 0, 0, 0.1));
    border-radius: 6px;
    background: transparent;
    color: var(--fgb-text-secondary, #6b7280);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}

    .btn-toolbar-share:hover {
        border-color: var(--fgb-accent, #10b981);
        color: var(--fgb-accent, #10b981);
        background: rgba(16, 185, 129, 0.06);
    }

[data-bs-theme="dark"] .btn-toolbar-share {
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

    [data-bs-theme="dark"] .btn-toolbar-share:hover {
        border-color: #10b981;
        color: #10b981;
        background: rgba(16, 185, 129, 0.08);
    }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .share-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .share-controls {
        padding: 12px 16px;
    }

    .share-design-picker {
        gap: 6px;
    }

    .share-design-thumb {
        min-width: 90px;
        padding: 8px 10px;
    }

    .share-design-preview-box {
        width: 64px;
        height: 36px;
    }

        .share-design-preview-box.square {
            width: 36px;
            height: 36px;
        }

    .share-options {
        flex-wrap: wrap;
        gap: 12px;
    }

    .share-preview-area {
        padding: 12px;
        min-height: 200px;
    }

    .share-actions {
        padding: 12px 16px;
        flex-direction: column;
    }

        .share-actions .btn {
            width: 100%;
            justify-content: center;
        }
}
