/* CookieYes Custom Styling for MansolPro.com */
/* Matches MansolPro branding: primary-blue (#15225c), accent-blue (#3b82f6) */

/* Ensure banner appears above all content */
.cky-consent-container {
    z-index: 10000 !important;
}

/* Banner wrapper styling */
[data-cky-tag="notice"],
.cky-notice {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Primary action button (Accept All) */
.cky-btn-accept,
[data-cky-tag="accept-button"] {
    background-color: #15225c !important;
    border-color: #15225c !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 0.5rem !important;
    transition: all 0.3s ease !important;
}

.cky-btn-accept:hover,
[data-cky-tag="accept-button"]:hover {
    background-color: #1e3a8a !important;
    border-color: #1e3a8a !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(21, 34, 92, 0.3) !important;
}

/* Secondary action buttons (Reject, Settings) */
.cky-btn-reject,
.cky-btn-customize,
.cky-btn-preferences,
[data-cky-tag="reject-button"],
[data-cky-tag="settings-button"] {
    background-color: transparent !important;
    border: 2px solid #15225c !important;
    color: #15225c !important;
    font-weight: 600 !important;
    border-radius: 0.5rem !important;
    transition: all 0.3s ease !important;
}

.cky-btn-reject:hover,
.cky-btn-customize:hover,
.cky-btn-preferences:hover,
[data-cky-tag="reject-button"]:hover,
[data-cky-tag="settings-button"]:hover {
    background-color: #f8fafc !important;
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
}

/* Settings/Preferences Modal */
.cky-preference-center,
.cky-modal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Modal header */
.cky-preference-header,
.cky-modal-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

/* Category toggles */
.cky-switch input:checked + .cky-slider,
.cky-accordion-chevron {
    background-color: #3b82f6 !important;
}

.cky-switch .cky-slider {
    background-color: #e2e8f0 !important;
}

/* Save preferences button */
.cky-btn-preferences-action,
[data-cky-tag="detail-save-button"] {
    background-color: #15225c !important;
    border-color: #15225c !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 0.5rem !important;
}

.cky-btn-preferences-action:hover,
[data-cky-tag="detail-save-button"]:hover {
    background-color: #1e3a8a !important;
    border-color: #1e3a8a !important;
}

/* Category headers */
.cky-accordion-header {
    font-weight: 600 !important;
    color: #15225c !important;
}

/* Category descriptions */
.cky-accordion-body {
    color: #334155 !important;
}

/* Links styling */
.cky-policy-link,
.cky-notice a {
    color: #3b82f6 !important;
    text-decoration: underline !important;
}

.cky-policy-link:hover,
.cky-notice a:hover {
    color: #15225c !important;
}

/* CCPA/CPRA "Do Not Sell" link styling */
.cky-do-not-sell-link {
    color: #3b82f6 !important;
}

/* ============================================
   COOKIEYES MOBILE BUTTON FIX
   Target: Xiaomi Mi Note 9 Pro & similar devices
   Fixes button text wrapping/truncating issues
   ============================================ */

/* Standard mobile responsiveness */
@media (max-width: 768px) {
    .cky-consent-bar,
    .cky-notice {
        padding: 16px !important;
    }

    /* Ensure banner doesn't overlap with chatbot on mobile */
    .cky-consent-container {
        bottom: 0 !important;
        margin-bottom: 0 !important;
    }
}

/* Force proper button sizing on all mobile viewports */
@media screen and (max-width: 480px) {

    /* Banner container adjustments */
    #cookieyes-banner .cky-notice-btn-wrapper,
    .cky-notice-btn-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        padding: 0 !important;
    }

    /* All CookieYes buttons - base fixes */
    .cky-btn,
    .cky-btn-accept,
    .cky-btn-reject,
    .cky-btn-customize,
    .cky-btn-preferences {
        /* Prevent text wrapping */
        white-space: nowrap !important;

        /* Ensure buttons take full width */
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;

        /* Prevent overflow */
        overflow: hidden !important;
        text-overflow: ellipsis !important;

        /* Consistent padding */
        padding: 12px 16px !important;

        /* Font sizing for readability */
        font-size: 14px !important;
        line-height: 1.4 !important;

        /* Box model fix */
        box-sizing: border-box !important;

        /* Center text */
        text-align: center !important;

        /* Prevent inline display issues */
        display: block !important;

        /* Margin reset */
        margin: 0 !important;
    }

    /* Accept button specific */
    .cky-btn-accept {
        order: 1;
    }

    /* Customize/Settings button */
    .cky-btn-customize,
    .cky-btn-preferences {
        order: 2;
    }

    /* Reject button */
    .cky-btn-reject {
        order: 3;
    }

    /* Modal button group fixes (for "Customize" popup) */
    .cky-preference-btn-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .cky-preference-btn-wrapper .cky-btn {
        width: 100% !important;
        white-space: nowrap !important;
    }
}

/* Extra narrow devices (some older Androids render at 360px) */
@media screen and (max-width: 380px) {

    .cky-btn,
    .cky-btn-accept,
    .cky-btn-reject,
    .cky-btn-customize,
    .cky-btn-preferences {
        /* Slightly smaller font for very narrow screens */
        font-size: 13px !important;
        padding: 10px 14px !important;
    }

    /* Reduce banner padding to maximize button space */
    #cookieyes-banner,
    .cky-consent-bar {
        padding: 12px !important;
    }

    .cky-notice-btn-wrapper {
        gap: 8px !important;
    }
}

/* Android-specific fixes (WebKit rendering quirks) */
@media screen and (max-width: 480px) {

    /* Force hardware acceleration for smoother rendering */
    .cky-btn,
    .cky-btn-accept,
    .cky-btn-reject,
    .cky-btn-customize {
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
        -webkit-font-smoothing: antialiased !important;
    }

    /* Prevent Android zoom-on-focus for buttons */
    .cky-btn,
    .cky-btn-accept,
    .cky-btn-reject,
    .cky-btn-customize {
        touch-action: manipulation !important;
    }
}

/* Fallback for aggressive text wrapping - wildcard selectors */
@media screen and (max-width: 480px) {

    /* If CookieYes uses different class structure */
    [class*="cky-btn"] {
        white-space: nowrap !important;
        width: 100% !important;
        display: block !important;
    }

    /* Container for button groups */
    [class*="cky-notice-btn"],
    [class*="cky-preference-btn"] {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }
}

/* AGGRESSIVE MOBILE FIX - Nuclear option for stubborn layouts */
@media screen and (max-width: 480px) {

    /* Reset ALL CookieYes button container layouts */
    #cookieyes-banner * {
        box-sizing: border-box !important;
    }

    /* Force stacked layout */
    #cookieyes-banner .cky-notice-des,
    #cookieyes-banner .cky-notice-btn-wrapper,
    #cookieyes-banner .cky-footer-wrapper {
        width: 100% !important;
        float: none !important;
        display: block !important;
    }

    /* Button wrapper must be flexbox column */
    .cky-notice-btn-wrapper,
    .cky-preference-btn-wrapper,
    .cky-footer-btn-wrapper {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
    }

    /* Every button must respect parent width */
    .cky-notice-btn-wrapper > *,
    .cky-preference-btn-wrapper > *,
    .cky-footer-btn-wrapper > * {
        flex: 0 0 auto !important;
        width: 100% !important;
        margin: 4px 0 !important;
    }
}

/* ============================================
   END MOBILE BUTTON FIX
   ============================================ */

/* Accessibility improvements */
.cky-btn:focus,
.cky-switch input:focus + .cky-slider,
.cky-accordion-btn:focus {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

/* Animation for banner appearance */
.cky-consent-bar {
    animation: slideUp 0.3s ease-out !important;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
