/**
 * InnoMobile Action - Mobile Sticky Bar Styles
 * 
 * @package InnoMobileAction
 * @since 1.0.0
 */

/* CRISP HYBRID APPROACH - SDK hides default widget, CSS ensures chat appears on top */

/* Ensure Crisp chat interface appears above mobile bar when opened */
.crisp-client,
#crisp-chatbox,
[class*="crisp-"],
.crisp-chat,
.crisp-chat-container {
    z-index: 999999 !important; /* Above mobile bar's 9999 */
}

/* Specifically target Crisp's main chat interface elements */
.cc-unread-count,
.cc-1hqb,
.cc-kken,
.cc-tlyw,
.cc-157aw {
    z-index: 999999 !important;
}

/* Ensure opened chat window appears on top */
.crisp-chat-opened,
[data-crisp-chat-opened="true"] {
    z-index: 999999 !important;
}

/* Hide scroll-to-top on mobile */
@media (max-width: 768px) {
    .scroll-top,
    .back-to-top,
    [class*="scroll-top"] {
        display: none !important;
    }
}

/* Graphics-Based 3-Column Layout: Call Graphic | Book Now | Chat Graphic */
.innomobile-bar {
    position: fixed;
    bottom: 0; /* Bottom edge */
    left: 0;
    right: 0;
    width: 100%; /* Force full width */
    z-index: 9999;
    display: flex;
    justify-content: space-between; /* Left, center, right */
    align-items: center;
    padding: 10px 15px; /* Reduced padding for tighter layout */
    background: transparent; /* Will be overridden by inline styles from settings */
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* Ensure background color covers full width */
.innomobile-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    z-index: -1;
}

/* Hide on desktop */
@media (min-width: 769px) {
    .innomobile-bar {
        display: none !important;
    }
}

/* LEFT: Call Graphic */
.innomobile-graphics-call {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex: 1;
    min-width: 0; /* Prevent flex item overflow */
}

.innomobile-call-graphic {
    display: block;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    line-height: 0; /* Remove line spacing */
}

.innomobile-call-graphic:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.innomobile-call-image {
    display: block;
    width: 120px;
    height: auto; /* Maintain aspect ratio */
    max-height: 57px;
    object-fit: contain;
    vertical-align: top;
}

/* CENTER: Customizable Book Now Button */
.innomobile-graphics-booking {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    min-width: 120px; /* Ensure consistent center width */
}

.innomobile-book-graphic {
    display: block;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 0; /* Remove line spacing */
}

.innomobile-book-graphic:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.innomobile-book-graphic:active {
    transform: translateY(0);
}

.innomobile-book-image {
    display: block;
    width: 120px;
    height: auto; /* Maintain aspect ratio */
    max-height: 57px;
    object-fit: contain;
    vertical-align: top;
}

/* RIGHT: Chat Graphic */
.innomobile-graphics-chat {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex: 1;
    min-width: 0; /* Prevent flex item overflow */
}

.innomobile-chat-graphic {
    display: block;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 0; /* Remove line spacing */
}

.innomobile-chat-graphic:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.innomobile-chat-image {
    display: block;
    width: 120px;
    height: auto; /* Maintain aspect ratio */
    max-height: 57px;
    object-fit: contain;
    vertical-align: top;
}

/* Left Section - Call (Circle + Green Box) */
.innomobile-call {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align to left */
    flex: 1; /* Take up left space */
}

.innomobile-call-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.innomobile-call-link:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.innomobile-phone-icon {
    width: 69px; /* 25% bigger: 55 * 1.25 = 69px */
    height: 69px;
    background: #1F5FFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
    position: relative;
    z-index: 2;
}

.innomobile-call-text {
    background: #46b450;
    color: white;
    padding: 10px 15px 10px 35px; /* Adjusted padding for bigger icon */
    border-radius: 0 20px 20px 0; /* Smaller radius */
    font-weight: 600;
    font-size: 14px; /* Smaller font */
    text-transform: uppercase;
    margin-left: -35px; /* Adjusted for bigger icon (69px) */
    min-width: 50px; /* Smaller min-width */
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Center Section - Book Now Button */
.innomobile-booking {
    display: flex;
    justify-content: center; /* Center the button */
    flex: 0 0 auto; /* Fixed size, don't grow/shrink */
}

.innomobile-book-btn {
    background: #1F5FFF;
    color: white;
    border: none;
    border-radius: 20px; /* Smaller radius */
    padding: 12px 16px; /* Fixed padding for center position */
    font-size: 14px; /* Smaller font */
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(31, 95, 255, 0.3);
    white-space: nowrap; /* Prevent text wrapping */
}

.innomobile-book-btn:hover {
    background: #1A52E6;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(31, 95, 255, 0.4);
}

.innomobile-book-btn:active {
    transform: translateY(0);
}

/* Right Section - Chat (Green Box + Space for Crisp) */
.innomobile-chat {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Align to right */
    flex: 1; /* Take up right space */
}

.innomobile-chat-btn {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.innomobile-chat-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.innomobile-chat-text {
    background: #46b450;
    color: white;
    padding: 10px 30px 10px 15px; /* Extra right padding for Crisp space */
    border-radius: 20px 0 0 20px; /* Squared right for Crisp */
    font-weight: 600;
    font-size: 14px; /* Smaller font */
    text-transform: uppercase;
    margin-right: 0; /* No negative margin - leave space for Crisp */
    min-width: 60px; /* Wider for Crisp compatibility */
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Blue circle removed - using extended green chat box instead */

/* Icon Containers */
.innomobile-icon-container {
    position: relative;
}

.innomobile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 480px) {
    .innomobile-bar {
        padding: 12px 15px;
        gap: 10px;
    }
    
    .innomobile-phone-icon,
    .innomobile-chat-icon {
        width: 60px;
        height: 60px;
    }
    
    .innomobile-call-text {
        margin-left: -30px; /* RESTORE negative margin for proper overlap */
        padding: 10px 18px 10px 35px; /* Extended left padding */
        min-width: 50px; /* Reduced for better centering */
        font-size: 14px;
        font-weight: 600;
        text-transform: uppercase;
        border-radius: 0 20px 20px 0; /* Squared left, rounded right */
    }
    
    .innomobile-chat-text {
        margin-right: -30px; /* RESTORE negative margin for proper overlap */
        padding: 10px 25px 10px 18px; /* Reduced right padding for centering */
        min-width: 50px; /* Reduced for better centering */
        font-size: 14px;
        font-weight: 600;
        text-transform: uppercase;
        border-radius: 20px 0 0 20px; /* Squared right, rounded left */
    }
    
    .innomobile-book-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .innomobile-bar {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .innomobile-phone-icon,
    .innomobile-chat-icon {
        width: 54px;
        height: 54px;
    }
    
    .innomobile-call-text {
        margin-left: -27px;
        padding: 8px 16px 8px 32px;
        min-width: 45px;
        font-size: 13px;
        font-weight: 600;
        text-transform: uppercase;
    }
    
    .innomobile-chat-text {
        margin-right: -27px;
        padding: 8px 32px 8px 16px;
        min-width: 45px;
        font-size: 13px;
        font-weight: 600;
        text-transform: uppercase;
    }
    
    .innomobile-book-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Modal Styles */
.innomobile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    overflow: hidden;
}

.innomobile-modal-content {
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
}

.innomobile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #1F5FFF;
    color: white;
    border-bottom: 1px solid #ddd;
}

.innomobile-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.innomobile-modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.innomobile-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.innomobile-modal-body {
    flex: 1;
    overflow: hidden;
}

.innomobile-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Loading state for modal */
.innomobile-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 16px;
    color: #666;
}

/* Show mobile bar only on mobile devices */
@media (max-width: 768px) {
    .innomobile-bar {
        display: flex !important;
    }
}
