/* Sticky CTA Button Admin Styles */

/* Basic Icon Replacements for Font Awesome in Admin */
.wp-sticky-cta-button-admin i[class*="fa-"],
.wp-sticky-cta-button-admin i[class*="scb-"] {
    font-style: normal;
    font-weight: normal;
    display: inline-block;
    text-decoration: inherit;
    width: auto;
    height: auto;
    line-height: normal;
    vertical-align: baseline;
}

/* Icon mappings using Unicode for Admin */
.wp-sticky-cta-button-admin .fa-rocket:before { content: "🚀"; }
.wp-sticky-cta-button-admin .fa-phone:before { content: "📞"; }
.wp-sticky-cta-button-admin .fa-envelope:before { content: "\2709\FE0F"; }
.wp-sticky-cta-button-admin .fa-shopping-cart:before { content: "🛒"; }
.wp-sticky-cta-button-admin .fa-star:before { content: "⭐"; }
.wp-sticky-cta-button-admin .fa-thumbs-up:before { content: "👍"; }
.wp-sticky-cta-button-admin .fa-fire:before { content: "🔥"; }
.wp-sticky-cta-button-admin .fa-bolt:before { content: "⚡"; }
.wp-sticky-cta-button-admin .fa-gift:before { content: "🎁"; }
.wp-sticky-cta-button-admin .fa-bullhorn:before { content: "📢"; }
.wp-sticky-cta-button-admin .fa-comment:before { content: "💬"; }
.wp-sticky-cta-button-admin .fa-user:before { content: "👤"; }
.wp-sticky-cta-button-admin .fa-cog:before { content: "\2699\FE0F"; }

/* "Own Image" option tile */
.wp-sticky-cta-button-admin .fa-custom-image:before { content: "\1F5BC\FE0F"; }

/* Single-color (mono) icons for Admin — text glyphs that inherit color */
.wp-sticky-cta-button-admin .scb-arrow-right:before { content: "\2192"; }
.wp-sticky-cta-button-admin .scb-arrow-up-right:before { content: "\2197\FE0E"; }
.wp-sticky-cta-button-admin .scb-arrow-down:before { content: "\2193"; }
.wp-sticky-cta-button-admin .scb-chevron-right:before { content: "\203A"; }
.wp-sticky-cta-button-admin .scb-plus:before { content: "\FF0B"; }
.wp-sticky-cta-button-admin .scb-check:before { content: "\2713"; }
.wp-sticky-cta-button-admin .scb-star:before { content: "\2605"; }
.wp-sticky-cta-button-admin .scb-heart:before { content: "\2665\FE0E"; }
.wp-sticky-cta-button-admin .scb-play:before { content: "\25B6\FE0E"; }
.wp-sticky-cta-button-admin .scb-refresh:before { content: "\21BB"; }

/* Phone, Email and Download render as SVG mask icons (see frontend notes) */
.wp-sticky-cta-button-admin .scb-phone:before,
.wp-sticky-cta-button-admin .scb-envelope:before,
.wp-sticky-cta-button-admin .scb-download:before {
    content: "";
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.18em;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.wp-sticky-cta-button-admin .scb-phone:before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.4 3H4.6C3.7 3 3 3.7 3 4.6 3 13.7 10.3 21 19.4 21c.9 0 1.6-.7 1.6-1.6v-2.8c0-.8-.6-1.5-1.4-1.6l-2.9-.4c-.5-.1-1 .1-1.4.4l-1.6 1.6c-2.5-1.3-4.6-3.4-5.9-5.9l1.6-1.6c.4-.4.5-.9.4-1.4L9 4.4C8.9 3.6 8.2 3 7.4 3z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.4 3H4.6C3.7 3 3 3.7 3 4.6 3 13.7 10.3 21 19.4 21c.9 0 1.6-.7 1.6-1.6v-2.8c0-.8-.6-1.5-1.4-1.6l-2.9-.4c-.5-.1-1 .1-1.4.4l-1.6 1.6c-2.5-1.3-4.6-3.4-5.9-5.9l1.6-1.6c.4-.4.5-.9.4-1.4L9 4.4C8.9 3.6 8.2 3 7.4 3z'/%3E%3C/svg%3E");
}

.wp-sticky-cta-button-admin .scb-envelope:before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12.5 2.7 6.4C3.2 5.6 4 5 5 5h14c1 0 1.8.6 2.3 1.4L12 12.5z'/%3E%3Cpath d='M12 14.9 22 8.3V17c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V8.3l10 6.6z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12.5 2.7 6.4C3.2 5.6 4 5 5 5h14c1 0 1.8.6 2.3 1.4L12 12.5z'/%3E%3Cpath d='M12 14.9 22 8.3V17c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V8.3l10 6.6z'/%3E%3C/svg%3E");
}

.wp-sticky-cta-button-admin .scb-download:before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 16 7 10h3V3h4v7h3l-5 6z'/%3E%3Cpath d='M4 18h16v3H4z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 16 7 10h3V3h4v7h3l-5 6z'/%3E%3Cpath d='M4 18h16v3H4z'/%3E%3C/svg%3E");
}

/* "No icon" option */
.wp-sticky-cta-button-admin .scb-none:before { content: "\2205"; }

/* Back to top icons for Admin */
.wp-sticky-cta-button-admin .fa-chevron-up:before { content: "▲"; }
.wp-sticky-cta-button-admin .fa-arrow-up:before { content: "↑"; }
.wp-sticky-cta-button-admin .fa-angle-up:before { content: "˄"; }
.wp-sticky-cta-button-admin .fa-caret-up:before { content: "▲"; }
.wp-sticky-cta-button-admin .fa-angle-double-up:before { content: "⌃"; }
.wp-sticky-cta-button-admin .fa-long-arrow-alt-up:before { content: "⇧"; }
.wp-sticky-cta-button-admin .fa-sort-up:before { content: "▲"; }
.wp-sticky-cta-button-admin .fa-level-up-alt:before { content: "↗"; }

.wp-sticky-cta-button-admin {
    max-width: 900px;
}

.wp-sticky-cta-button-admin h1 {
    color: #17525b;
    font-size: 23px;
    margin-bottom: 4px;
}

.wp-sticky-cta-button-admin .wp-sticky-subtitle {
    color: #50575e;
    margin: 0 0 16px;
    font-size: 13px;
}

/* Tabs */
.wp-sticky-tabs {
    margin-bottom: 16px;
}

.wp-sticky-tab-panel.hidden {
    display: none;
}

/* Color picker alignment */
.wp-sticky-color-field {
    max-width: 100px;
}

/* Live preview */
.wp-sticky-preview {
    background: #1e2327;
    background-image: linear-gradient(135deg, #2c3338, #1e2327);
    border-radius: 8px;
    padding: 22px 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.wp-sticky-preview-label {
    position: absolute;
    top: 10px;
    left: 14px;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
}

.wp-sticky-preview-stage {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-top: 14px;
}

.wp-sticky-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    border-radius: 25px;
    background: #17525b;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.wp-sticky-preview-btn i {
    font-size: 16px;
    line-height: 1;
}

/* Postbox Styling */
.wp-sticky-cta-button-admin .postbox {
    margin-bottom: 20px;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wp-sticky-cta-button-admin .postbox h2.hndle {
    background: #17525b;
    color: white;
    padding: 15px 20px;
    margin: 0;
    border-radius: 7px 7px 0 0;
    font-size: 16px;
    font-weight: 600;
    cursor: default;
}

.wp-sticky-cta-button-admin .postbox .inside {
    padding: 20px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #17525b;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Icon Selector */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.icon-group-label {
    grid-column: 1 / -1;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #50575e;
    margin: 4px 0 -2px;
}

.icon-group-label:first-child {
    margin-top: 0;
}

.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.icon-option:hover {
    border-color: #17525b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.icon-option.selected {
    border-color: #17525b;
    background: #17525b;
    color: white;
}

.icon-option i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #17525b;
    line-height: 1;
}

.icon-option.selected i {
    color: white;
}

.icon-option-none i {
    color: #8c8f94;
}

.icon-option-none.selected i {
    color: white;
}

/* Custom icon picker row (below the icon grid) */
.custom-icon-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.custom-icon-row .custom-icon-preview {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background:
        linear-gradient(45deg, #e0e0e0 25%, transparent 25%, transparent 75%, #e0e0e0 75%),
        linear-gradient(45deg, #e0e0e0 25%, #ffffff 25%, #ffffff 75%, #e0e0e0 75%);
    background-size: 12px 12px;
    background-position: 0 0, 6px 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.custom-icon-row .description {
    flex-basis: 100%;
    margin: 0;
}

/* Custom image in the live preview */
.wp-sticky-preview-btn img.prev-custom {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: none;
}

/* Ensure icons display properly in admin */
.icon-option i[class*="fa-"],
.icon-option i[class*="scb-"] {
    font-size: 28px;
    line-height: 1;
}

.icon-option span {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
}

/* Position Selector */
.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.position-option {
    cursor: pointer;
    display: block;
}

.position-option input[type="radio"] {
    display: none;
}

.position-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.position-option:hover .position-visual {
    border-color: #17525b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.position-option.selected .position-visual {
    border-color: #17525b;
    background: #f0f8ff;
}

.screen-representation {
    width: 80px;
    height: 60px;
    background: #f5f5f5;
    border: 2px solid #ccc;
    border-radius: 4px;
    position: relative;
    margin-bottom: 10px;
}

.button-dot {
    width: 8px;
    height: 8px;
    background: #17525b;
    border-radius: 50%;
    position: absolute;
}

.position-visual.top-left .button-dot {
    top: 8px;
    left: 8px;
}

.position-visual.top-center .button-dot {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.position-visual.top-right .button-dot {
    top: 8px;
    right: 8px;
}

.position-visual.center-left .button-dot {
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
}

.position-visual.center-right .button-dot {
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
}

.position-visual.bottom-left .button-dot {
    bottom: 8px;
    left: 8px;
}

.position-visual.bottom-center .button-dot {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.position-visual.bottom-right .button-dot {
    bottom: 8px;
    right: 8px;
}

.position-visual span {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

/* Submit Button */
.wp-sticky-cta-button-admin .button-hero {
    background: #17525b !important;
    border-color: #17525b !important;
    color: white !important;
    font-size: 16px !important;
    padding: 12px 30px !important;
    border-radius: 6px !important;
    margin-top: 20px;
}

.wp-sticky-cta-button-admin .button-hero:hover {
    background: #0f3d44 !important;
    border-color: #0f3d44 !important;
}
