/* ============================================================
   Blog Share Modal — blog-share-modal.css
   Scoped entirely under .bs-* to avoid collisions
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
.bs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    animation: bs-fade-in 0.22s ease;
}

.bs-overlay.bs-open {
    display: flex;
}

@keyframes bs-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal Panel (slides in from right) ──────────────────── */
.bs-modal {
    width: 460px;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.2);
    animation: bs-slide-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes bs-slide-in {
    from { transform: translateX(100%); opacity: 0.5; }
    to   { transform: translateX(0);    opacity: 1;   }
}

/* ── Header ──────────────────────────────────────────────── */
.bs-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #A30000 0%, #850000 100%);
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.bs-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bs-icon-wrap {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    flex-shrink: 0;
}

.bs-header-text .bs-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 2px;
    letter-spacing: -0.01em;
}

.bs-header-text .bs-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.bs-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.bs-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

/* ── Modal Body ──────────────────────────────────────────── */
.bs-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #ffffff;
    box-sizing: border-box;
}

.bs-modal-body::-webkit-scrollbar {
    width: 5px;
}

.bs-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.bs-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.bs-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Section ─────────────────────────────────────────────── */
.bs-section {
    margin-bottom: 12px;
}

.bs-section-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}

.bs-section-label i {
    font-size: 13px;
    color: #A30000;
}

/* ── Field Rows & Groups ─────────────────────────────────── */
.bs-fields-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.bs-field-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bs-field-full {
    flex: 1 1 100%;
}

.bs-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    display: block;
}

.bs-required {
    color: #A30000;
    margin-left: 2px;
    font-weight: 700;
}

.bs-optional {
    font-weight: 400;
    color: #9ca3af;
    font-size: 11px;
}

/* ── Inputs ──────────────────────────────────────────────── */
.bs-input {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #1e293b;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

.bs-input:focus {
    border-color: #A30000;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(163, 0, 0, 0.1);
}

.bs-input[readonly] {
    background: #f8fafc;
    color: #64748b;
    cursor: default;
    border-color: #e2e8f0;
}

.bs-input.bs-input-error {
    border-color: #dc2626;
    background: #fef2f2;
}

/* ── Phone field ─────────────────────────────────────────── */
.bs-field-phone {
    flex: 1 1 auto;
}

.bs-phone-wrap {
    display: flex;
    gap: 0;
}

.bs-select-code {
    border: 1.5px solid #e2e8f0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 8px 8px;
    font-size: 12.5px;
    background: #f8fafc;
    color: #334155;
    outline: none;
    cursor: pointer;
    min-width: 64px;
    transition: border-color 0.2s;
}

.bs-select-code:focus {
    border-color: #A30000;
}

.bs-input-phone {
    border-radius: 0 8px 8px 0 !important;
    flex: 1;
}

/* ── Textarea ────────────────────────────────────────────── */
.bs-textarea {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #1e293b;
    background: #ffffff;
    resize: vertical;
    min-height: 65px;
    max-height: 120px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    line-height: 1.45;
}

.bs-textarea:focus {
    border-color: #A30000;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(163, 0, 0, 0.1);
}

/* ── Default message hint ────────────────────────────────── */
.bs-default-msg-hint {
    margin-top: 4px;
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bs-default-msg-hint i {
    color: #94a3b8;
    font-size: 11px;
}

/* ── Dividers ────────────────────────────────────────────── */
.bs-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 12px;
}

.bs-divider-line {
    flex: 1;
    height: 1px;
    background: #f1f5f9;
}

.bs-divider-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #A30000;
    flex-shrink: 0;
}

.bs-divider-thin {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0 12px;
}

/* ── Field error messages ────────────────────────────────── */
.bs-field-err {
    font-size: 11px;
    color: #dc2626;
    margin-top: 2px;
    min-height: 14px;
    display: block;
}

/* ── Footer ──────────────────────────────────────────────── */
.bs-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    flex-shrink: 0;
}

.bs-cancel-btn {
    background: #ffffff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bs-cancel-btn:hover {
    border-color: #9ca3af;
    color: #0f172a;
    background: #f1f5f9;
}

.bs-send-btn {
    background: #A30000;
    border: none;
    border-radius: 8px;
    padding: 9px 22px;
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(163, 0, 0, 0.2);
    letter-spacing: 0.1px;
}

.bs-send-btn:hover {
    background: #850000;
    box-shadow: 0 4px 14px rgba(163, 0, 0, 0.32);
    transform: translateY(-1px);
}

.bs-send-btn:active {
    transform: translateY(0);
}

.bs-send-btn:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.bs-send-btn i {
    font-size: 13px;
}

/* ── Success state overlay inside modal ──────────────────── */
.bs-success-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 24px;
    text-align: center;
    gap: 14px;
}

.bs-success-state.bs-visible {
    display: flex;
}

.bs-success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #ecfdf5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #10b981;
    animation: bs-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bs-pop {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.bs-success-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.bs-success-sub {
    font-size: 13.5px;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

/* ── Card share button ──────────────────────────────────── */
.blog-card-share-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1.05rem;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.blog-card-share-btn:hover {
    color: #A30000;
    background: rgba(163, 0, 0, 0.08);
    transform: scale(1.15);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 540px) {
    .bs-modal {
        width: 100vw;
    }

    .bs-fields-row {
        flex-direction: column;
        gap: 8px;
    }

    .bs-modal-header {
        padding: 14px 16px;
    }

    .bs-modal-body {
        padding: 14px 16px;
    }

    .bs-modal-footer {
        padding: 12px 16px;
    }
}
