/**
 * Stylesheet Frontend cho EMT Smart Contact & CTA (Public CSS)
 * Đảm bảo thẩm mỹ đỉnh cao: Glassmorphism, Micro-animations, zero CLS, responsive hoàn hảo
 */

/* ==========================================================================
   1. CORE FLOATING WIDGET & BUBBLE (Desktop / Floating Mobile)
   ========================================================================== */
.scc-floating-wrap {
    position: fixed;
    bottom: 80px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.scc-float-right {
    right: 20px;
    align-items: flex-end;
}

.scc-float-left {
    left: 20px;
    align-items: flex-start;
}

/* Nút bong bóng chính (Bubble Trigger) */
.scc-bubble-trigger {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 104, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.scc-bubble-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 30px rgba(0, 104, 255, 0.4);
}

.scc-bubble-trigger svg {
    width: 26px;
    height: 26px;
    transition: all 0.2s ease;
}

/* Danh sách nút con */
.scc-floating-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.scc-floating-buttons.scc-is-expandable {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
    position: absolute;
    bottom: 68px;
}

/* Khi active mở rộng */
.scc-floating-wrap.scc-expanded .scc-floating-buttons.scc-is-expandable {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Chi tiết nút liên hệ bay */
.scc-float-btn {
    display: flex;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
    overflow: hidden;
    height: 48px;
    max-width: 48px;
    border-radius: 24px;
}

.scc-float-btn:hover {
    max-width: 220px;
    padding-right: 18px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.scc-btn-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.scc-btn-icon svg {
    width: 22px;
    height: 22px;
}

.scc-btn-label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
    margin-left: 2px;
}

.scc-float-btn:hover .scc-btn-label {
    opacity: 1;
}

/* Hình dáng nút */
.scc-shape-circle .scc-float-btn,
.scc-shape-circle .scc-bubble-trigger {
    border-radius: 50% !important;
}

.scc-shape-square .scc-float-btn,
.scc-shape-square .scc-bubble-trigger {
    border-radius: 4px !important;
}

.scc-shape-round .scc-float-btn,
.scc-shape-round .scc-bubble-trigger {
    border-radius: 8px !important;
}

/* ==========================================================================
   2. MOBILE BOTTOM STICKY BAR
   ========================================================================== */
.scc-mobile-bar-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
    z-index: 9999;
}

.scc-mobile-bar-inner {
    display: flex;
    width: 100%;
    height: 60px;
}

.scc-mobile-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    background: transparent;
    transition: all 0.2s ease;
}

.scc-mobile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    margin-bottom: 3px;
}

.scc-mobile-icon svg {
    width: 20px;
    height: 20px;
}

.scc-mobile-label {
    font-size: 10px;
    line-height: 1;
}

/* iOS Safe Area Padding */
.scc-safe-area-active {
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
}

/* ==========================================================================
   3. BOTTOM SHEET MENU (Mobile More Option)
   ========================================================================== */
.scc-bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.scc-bottom-sheet-overlay.scc-sheet-active {
    opacity: 1;
    visibility: visible;
}

.scc-bottom-sheet-content {
    width: 100%;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.scc-bottom-sheet-overlay.scc-sheet-active .scc-bottom-sheet-content {
    transform: translateY(0);
}

.scc-bottom-sheet-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scc-bottom-sheet-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1d2327;
}

.scc-bottom-sheet-close {
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.scc-bottom-sheet-body {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    overflow-y: auto;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.scc-sheet-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.scc-sheet-item:active {
    transform: scale(0.97);
}

/* ==========================================================================
   4. MODAL POPUP (Lead Form)
   ========================================================================== */
.scc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 16px;
}

.scc-modal-overlay.scc-modal-active {
    opacity: 1;
    visibility: visible;
}

.scc-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scc-modal-overlay.scc-modal-active .scc-modal-content {
    transform: scale(1) translateY(0);
}

.scc-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.scc-modal-close:hover {
    opacity: 1;
}

.scc-modal-header {
    padding: 30px 30px 20px 30px;
    text-align: center;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #f0f0f0;
}

.scc-modal-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

.scc-modal-header p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.scc-modal-body {
    padding: 30px;
}

.scc-form-row {
    margin-bottom: 16px;
}

.scc-form-row input[type="text"],
.scc-form-row input[type="email"],
.scc-form-row textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.scc-form-row input:focus,
.scc-form-row textarea:focus {
    border-color: #0068ff;
    box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.15);
    outline: none;
}

.scc-submit-btn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 104, 255, 0.25);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.scc-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 104, 255, 0.35);
}

.scc-form-response {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.scc-form-response.scc-success {
    background: #def7ec;
    color: #03543f;
}

.scc-form-response.scc-error {
    background: #fde8e8;
    color: #9b1c1c;
}

/* Spinner */
.scc-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: scc-spin 0.8s linear infinite;
}

@keyframes scc-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   5. POST END CTA BOX (Call To Action Box)
   ========================================================================== */
.scc-cta-box-wrap {
    margin: 40px 0;
    padding: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(243, 244, 246, 0.4) 100%);
    border-left: 5px solid #0068ff;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

@media (max-width: 768px) {
    .scc-cta-box-wrap {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 20px;
    }
}

.scc-cta-box-content {
    flex: 1;
}

.scc-cta-title {
    margin: 0 0 6px 0 !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #111827;
}

.scc-cta-desc {
    margin: 0 !important;
    font-size: 13px !important;
    color: #4b5563;
    line-height: 1.5;
}

.scc-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
    justify-content: center;
}

.scc-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.scc-cta-icon-svg {
    display: flex;
    align-items: center;
}

.scc-cta-icon-svg svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   6. SHORTCODE LIST INLINE STYLE
   ========================================================================== */
.scc-shortcode-list-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}

.scc-shortcode-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.scc-shortcode-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.scc-shortcode-icon {
    display: flex;
    align-items: center;
}

.scc-shortcode-icon svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   7. RESPONSIVE CONTAINER TOGGLE (Anti-Caching System)
   ========================================================================== */
@media (min-width: 768px) {
    #scc-desktop-widget-container {
        display: block !important;
    }
    #scc-mobile-widget-container {
        display: none !important;
    }
}

@media (max-width: 767px) {
    #scc-desktop-widget-container {
        display: none !important;
    }
    #scc-mobile-widget-container {
        display: block !important;
    }
}
