/* Frontend Styles for Floating Contact Sidebar v2.1 */

/* ================================
   PC Desktop Sidebar
   ================================ */
.fcs-sidebar-desktop {
    position: fixed;
    right: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.fcs-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fcs-button-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* ================================
   Desktop Button Styles
   ================================ */
.fcs-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50% 0 0 50%;
    background-color: #2c3e50;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.2);
}

.fcs-button:hover {
    background-color: #f1c40f;
    color: #fff;
    transform: translateX(-5px);
}

/* Icon color change on hover */
.fcs-sidebar-desktop .fcs-button:hover .dashicons {
    color: var(--icon-hover-color, #ffffff);
}

.fcs-sidebar-desktop .fcs-button:hover .fcs-custom-icon {
    filter: brightness(0) invert(1);
}

.fcs-button:active,
.fcs-button.active {
    background-color: #1a365d !important;
    color: #fff;
    transform: translateX(-3px);
}

.fcs-button:focus {
    outline: none;
}

/* Icon Styles */
.fcs-button .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    color: inherit;
}

.fcs-button .fcs-custom-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.fcs-button:hover .fcs-custom-icon {
    filter: brightness(0) invert(1);
}

/* ================================
   Desktop Tooltip Styles
   ================================ */
.fcs-tooltip {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 15px;
    background-color: #f1c40f;
    color: #333;
    padding: 10px 15px;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.fcs-tooltip::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 10px;
    border-style: solid;
    border-color: transparent transparent transparent #f1c40f;
}

.fcs-button-wrapper:hover .fcs-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.fcs-tooltip-simple {
    display: flex;
    align-items: center;
    gap: 5px;
}

.fcs-tooltip-label {
    font-weight: 600;
    font-size: 14px;
}

.fcs-tooltip-value {
    font-size: 14px;
}

/* QR Code Tooltip */
.fcs-tooltip-qrcode {
    padding: 15px;
    white-space: normal;
    min-width: 160px;
    text-align: center;
}

.fcs-qrcode-wrapper {
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: inline-block;
}

.fcs-qrcode-img {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.fcs-tooltip-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fcs-tooltip-info .fcs-tooltip-label {
    font-size: 12px;
    color: #666;
}

.fcs-tooltip-info .fcs-tooltip-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* ================================
   Mobile Bottom Navigation Bar
   ================================ */
.fcs-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    background-color: #2c3e50;
    z-index: 99999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.fcs-mobile-bar.fcs-bar-hidden {
    transform: translateY(100%);
}

.fcs-mobile-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    color: #fff;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 60px;
}

.fcs-mobile-item:last-child {
    border-right: none;
}

.fcs-mobile-item:active {
    background-color: #1a365d;
}

.fcs-mobile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.fcs-mobile-icon .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    line-height: 22px;
    color: #fff;
}

.fcs-mobile-icon .fcs-custom-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.fcs-mobile-label {
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    line-height: 1.2;
}

/* ================================
   Mobile WeChat Popup
   ================================ */
.fcs-wechat-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.fcs-wechat-popup.active {
    display: flex;
}

.fcs-wechat-popup-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    position: relative;
    max-width: 280px;
    width: 90%;
}

.fcs-wechat-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.fcs-wechat-popup-close:hover {
    color: #333;
}

.fcs-wechat-popup-qr {
    margin-bottom: 15px;
}

.fcs-wechat-popup-qr img {
    width: 180px;
    height: 180px;
    object-fit: contain;
}

.fcs-wechat-popup-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fcs-wechat-popup-label {
    font-size: 14px;
    color: #666;
}

.fcs-wechat-popup-id {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* ================================
   Popup Overlay & Container
   ================================ */
.fcs-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fcs-popup-overlay.active {
    display: flex;
    opacity: 1;
}

.fcs-popup-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.fcs-popup-overlay.active .fcs-popup-container {
    transform: translateY(0);
}

.fcs-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: #e8f5e9;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4caf50;
    transition: all 0.3s ease;
    z-index: 10;
}

.fcs-popup-close:hover {
    background: #4caf50;
    color: #fff;
}

.fcs-popup-content {
    padding: 40px;
}

.fcs-popup-title {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin: 0 0 30px 0;
    padding: 0;
}

/* ================================
   Form Styles
   ================================ */
.fcs-inquiry-form {
    width: 100%;
}

.fcs-form-row {
    margin-bottom: 20px;
}

.fcs-form-row-three {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    align-items: end;
}

.fcs-form-group {
    display: flex;
    flex-direction: column;
}

.fcs-form-group-full {
    width: 100%;
}

.fcs-form-label {
    font-size: 14px;
    color: #e74c3c;
    margin-bottom: 8px;
    font-weight: 500;
}

.fcs-form-input,
.fcs-form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.fcs-form-textarea {
    border-radius: 15px;
    resize: vertical;
    min-height: 120px;
}

.fcs-form-input:focus,
.fcs-form-textarea:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.fcs-form-input::placeholder,
.fcs-form-textarea::placeholder {
    color: #999;
}

.fcs-form-row-submit {
    text-align: center;
    margin-top: 25px;
}

.fcs-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 14px 40px;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.fcs-submit-btn:hover {
    background: #43a047;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.fcs-submit-btn:active {
    transform: translateY(0);
}

.fcs-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading Spinner */
.fcs-spinner {
    animation: fcs-spin 1s linear infinite;
}

.fcs-spinner-circle {
    stroke-dasharray: 60;
    stroke-dashoffset: 45;
}

@keyframes fcs-spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Form Message */
.fcs-form-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
}

.fcs-form-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.fcs-form-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* ================================
   Custom Icons (WhatsApp, WeChat)
   ================================ */
.dashicons-whatsapp::before {
    content: '';
    display: inline-block;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.dashicons-wechat::before {
    content: '';
    display: inline-block;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm5.34 2.867c-1.797-.052-3.746.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22.942 2.453 3.666 4.229 6.884 4.229.826 0 1.622-.12 2.361-.336a.722.722 0 01.598.082l1.584.926a.272.272 0 00.139.045c.133 0 .241-.108.241-.243 0-.06-.023-.118-.039-.177l-.326-1.233a.49.49 0 01.178-.553C23.064 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.269-.027-.406-.032zm-2.53 3.274c.535 0 .969.44.969.982a.976.976 0 01-.969.983.976.976 0 01-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 01-.969.983.976.976 0 01-.969-.983c0-.542.434-.982.969-.982z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* ================================
   Responsive - Mobile (≤768px)
   ================================ */
@media screen and (max-width: 768px) {
    /* Hide desktop sidebar */
    .fcs-sidebar-desktop {
        display: none !important;
    }
    
    /* Show mobile bottom bar */
    .fcs-mobile-bar {
        display: flex;
    }
    
    /* Note: Footer padding is applied dynamically via JavaScript based on user settings */
    
    /* Popup adjustments */
    .fcs-popup-overlay {
        padding: 15px;
        padding-bottom: 75px;
    }
    
    .fcs-popup-container {
        max-width: 100%;
        border-radius: 10px;
        max-height: calc(100vh - 90px);
    }
    
    .fcs-popup-content {
        padding: 30px 20px;
    }
    
    .fcs-popup-title {
        font-size: 22px;
        margin-bottom: 25px;
    }
    
    .fcs-form-row-three {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .fcs-form-input,
    .fcs-form-textarea {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .fcs-submit-btn {
        width: 100%;
        padding: 14px 30px;
    }
}

/* ================================
   Responsive - Small Mobile (≤480px)
   ================================ */
@media screen and (max-width: 480px) {
    .fcs-mobile-item {
        padding: 8px 3px;
        min-height: 55px;
    }
    
    .fcs-mobile-icon .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }
    
    .fcs-mobile-label {
        font-size: 10px;
    }
    
    .fcs-popup-content {
        padding: 25px 15px;
    }
    
    .fcs-popup-title {
        font-size: 20px;
    }
    
    .fcs-popup-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
    }
}

/* ================================
   Print Styles
   ================================ */
@media print {
    .fcs-sidebar-desktop,
    .fcs-mobile-bar,
    .fcs-popup-overlay,
    .fcs-wechat-popup {
        display: none !important;
    }
    
    body {
        padding-bottom: 0 !important;
    }
}

/* ================================
   Animations
   ================================ */
@keyframes fcs-pulse {
    0% {
        box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: -2px 2px 20px rgba(0, 0, 0, 0.4);
    }
    100% {
        box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.2);
    }
}

.fcs-button-wrapper:first-child .fcs-button {
    animation: fcs-pulse 2s infinite;
}

/* Body scroll lock when popup is open */
body.fcs-popup-open {
    overflow: hidden;
}

/* ================================
   Back to Top Button
   ================================ */
.fcs-backtop-btn {
    position: fixed;
    bottom: var(--backtop-offset-y, 100px);
    width: var(--backtop-size, 45px);
    height: var(--backtop-size, 45px);
    background-color: var(--backtop-color, #3498db);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--backtop-shadow, 0 4px 15px rgba(0, 0, 0, 0.2));
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99998;
}

.fcs-backtop-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fcs-backtop-btn:hover {
    background-color: var(--backtop-hover, #2980b9);
    transform: translateY(-3px);
}

.fcs-backtop-btn:active {
    transform: translateY(0);
}

.fcs-backtop-btn svg {
    width: var(--backtop-icon-size, 50%);
    height: var(--backtop-icon-size, 50%);
}

.fcs-backtop-btn .fcs-backtop-text {
    font-size: var(--backtop-text-size, 12px);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.fcs-backtop-btn .fcs-backtop-custom-img {
    width: var(--backtop-icon-size, 60%);
    height: var(--backtop-icon-size, 60%);
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* ================================
   Back to Top - Responsive
   ================================ */
@media screen and (max-width: 768px) {
    .fcs-backtop-btn {
        bottom: var(--backtop-mobile-offset-y, 80px);
        width: 40px;
        height: 40px;
    }
    
    .fcs-backtop-btn.fcs-backtop-hide-mobile {
        display: none !important;
    }
}

@media screen and (max-width: 480px) {
    .fcs-backtop-btn {
        width: 38px;
        height: 38px;
    }
}

/* ================================
   Print - Hide Back to Top
   ================================ */
@media print {
    .fcs-backtop-btn {
        display: none !important;
    }
}
