/* =========================================================
   IR MUSIC - SONG DEDICATION
   Main Frontend Styles
   ========================================================= */


/* =========================================================
   VARIABLES
   ========================================================= */

:root {
    --ird-primary: #e83e8c;
    --ird-primary-dark: #c92f75;
    --ird-text: #202124;
    --ird-muted: #777;
    --ird-border: #e8e8e8;
    --ird-bg: #ffffff;
    --ird-soft-bg: #f8f8fa;
    --ird-radius: 18px;
    --ird-shadow: 0 15px 45px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   OPEN BUTTON
   ========================================================= */

.ir-dedication-open {
    appearance: none;
    border: 0;
    outline: 0;
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 11px 20px;

    min-height: 44px;

    border-radius: 12px;

    background: var(--ird-primary);
    color: #fff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    line-height: 1.5;

    text-decoration: none;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.ir-dedication-open:hover {
    background: var(--ird-primary-dark);

    transform: translateY(-2px);

    box-shadow:
        0 8px 25px rgba(232, 62, 140, .25);
}

.ir-dedication-open:active {
    transform: translateY(0);
}


/*
 * Allow theme/site CSS to override the button.
 */

.ir-dedication-open.ir-custom-button {
    background: inherit;
    color: inherit;
}


/* =========================================================
   POPUP
   ========================================================= */

.ir-dedication-popup {
    position: fixed;

    inset: 0;

    z-index: 999999;

    display: none;

    direction: rtl;
}

.ir-dedication-popup.is-open {
    display: flex;

    align-items: center;
    justify-content: center;
}


/* Overlay */

.ir-dedication-popup-overlay {
    position: absolute;

    inset: 0;

    background:
        rgba(0, 0, 0, .62);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}


/* Prevent scrolling while popup is open */

body.ir-dedication-popup-open {
    overflow: hidden;
}


/* =========================================================
   POPUP BOX
   ========================================================= */

.ir-dedication-popup-box {
    position: relative;

    z-index: 2;

    width: calc(100% - 30px);
    max-width: 620px;

    max-height: calc(100vh - 30px);

    overflow-y: auto;

    background: #fff;

    border-radius: 24px;

    box-shadow:
        0 30px 100px rgba(0, 0, 0, .25);

    animation:
        irDedicationPopupIn .25s ease both;

    scrollbar-width: thin;
}

@keyframes irDedicationPopupIn {

    from {
        opacity: 0;
        transform: translateY(25px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

.ir-dedication-popup-close {
    position: absolute;

    top: 16px;
    left: 16px;

    z-index: 10;

    width: 38px;
    height: 38px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: rgba(0, 0, 0, .06);

    color: #555;

    font-family: Arial, sans-serif;

    font-size: 26px;

    line-height: 38px;

    text-align: center;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;
}

.ir-dedication-popup-close:hover {
    background: rgba(0, 0, 0, .12);

    transform: rotate(90deg);
}


/* =========================================================
   POPUP HEADER
   ========================================================= */

.ir-dedication-popup-header {
    padding: 35px 35px 20px;

    text-align: center;
}

.ir-dedication-popup-header h3 {
    margin: 0 0 8px;

    color: var(--ird-text);

    font-size: 25px;
    font-weight: 800;

    line-height: 1.5;
}

.ir-dedication-popup-header p {
    margin: 0;

    color: var(--ird-muted);

    font-size: 14px;

    line-height: 1.8;
}


/* =========================================================
   FORM
   ========================================================= */

.ir-dedication-form {
    padding: 0 35px 35px;
}

.ir-dedication-form-fields {
    display: block;
}


/* =========================================================
   FIELD
   ========================================================= */

.ir-dedication-field {
    margin-bottom: 20px;
}

.ir-dedication-field > label {
    display: block;

    margin-bottom: 8px;

    color: #333;

    font-size: 14px;
    font-weight: 700;
}

.ir-dedication-field input[type="text"],
.ir-dedication-field textarea {
    display: block;

    width: 100%;

    box-sizing: border-box;

    border: 1px solid var(--ird-border);

    border-radius: 13px;

    background: #fafafa;

    color: #222;

    font-family: inherit;

    font-size: 14px;

    line-height: 1.8;

    outline: none;

    transition:
        border-color .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}

.ir-dedication-field input[type="text"] {
    min-height: 48px;

    padding: 10px 14px;
}

.ir-dedication-field textarea {
    min-height: 145px;

    padding: 12px 14px;

    resize: vertical;
}

.ir-dedication-field input[type="text"]:focus,
.ir-dedication-field textarea:focus {
    border-color: var(--ird-primary);

    background: #fff;

    box-shadow:
        0 0 0 4px rgba(232, 62, 140, .08);
}

.ir-dedication-field input::placeholder,
.ir-dedication-field textarea::placeholder {
    color: #aaa;
}


/* =========================================================
   CHARACTER COUNTER
   ========================================================= */

.ir-dedication-counter {
    display: flex;

    justify-content: flex-start;
    align-items: center;

    gap: 4px;

    margin-top: 6px;

    color: #999;

    font-size: 12px;
}

.ir-dedication-current-count {
    color: var(--ird-primary);

    font-weight: 700;
}


/* =========================================================
   THEMES GRID
   ========================================================= */

.ir-dedication-themes {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 12px;
}


/* =========================================================
   THEME CARD
   ========================================================= */

.ir-dedication-theme-card {
    position: relative;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    min-height: 105px;

    padding: 12px;

    border: 2px solid #ededed;

    border-radius: 16px;

    background: #fff;

    cursor: pointer;

    text-align: center;

    overflow: hidden;

    transition:
        border-color .2s ease,
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.ir-dedication-theme-card:hover {
    border-color: #ddd;

    transform: translateY(-2px);

    box-shadow:
        0 8px 25px rgba(0, 0, 0, .07);
}


/* Hide native radio */

.ir-dedication-theme-card input[type="radio"] {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;

    pointer-events: none;
}


/* Selected */

.ir-dedication-theme-card.is-selected {
    border-color: var(--ird-primary);

    background:
        rgba(232, 62, 140, .04);

    box-shadow:
        0 8px 25px rgba(232, 62, 140, .12);
}


/* =========================================================
   THEME PREVIEW
   ========================================================= */

.ir-dedication-theme-preview {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    margin-bottom: 7px;

    border-radius: 14px;

    background: #f7f7f8;

    font-size: 25px;

    line-height: 1;

    transition: transform .2s ease;
}

.ir-dedication-theme-card:hover
.ir-dedication-theme-preview {
    transform: scale(1.08);
}

.ir-dedication-theme-name {
    color: #444;

    font-size: 12px;
    font-weight: 700;

    line-height: 1.5;
}


/* =========================================================
   ACTIONS
   ========================================================= */

.ir-dedication-actions {
    display: flex;

    gap: 10px;

    margin-top: 25px;
}

.ir-dedication-submit,
.ir-dedication-cancel {
    min-height: 48px;

    border: 0;

    border-radius: 13px;

    font-family: inherit;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.ir-dedication-submit {
    flex: 1;

    background:
        linear-gradient(
            135deg,
            #e83e8c,
            #c92f75
        );

    color: #fff;

    box-shadow:
        0 8px 25px rgba(232, 62, 140, .22);
}

.ir-dedication-submit:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 30px rgba(232, 62, 140, .3);
}

.ir-dedication-submit:disabled {
    opacity: .65;

    cursor: wait;

    transform: none;
}

.ir-dedication-cancel {
    width: 110px;

    background: #f1f1f3;

    color: #555;
}

.ir-dedication-cancel:hover {
    background: #e7e7e9;
}


/* =========================================================
   LOADING
   ========================================================= */

.ir-dedication-submit.is-loading {
    position: relative;

    color: transparent;
}

.ir-dedication-submit.is-loading::after {
    content: "";

    position: absolute;

    top: 50%;
    left: 50%;

    width: 20px;
    height: 20px;

    margin:
        -10px 0 0 -10px;

    border: 3px solid rgba(255,255,255,.4);

    border-top-color: #fff;

    border-radius: 50%;

    animation:
        irDedicationSpin .7s linear infinite;
}

@keyframes irDedicationSpin {

    to {
        transform: rotate(360deg);
    }

}


/* =========================================================
   RESULT
   ========================================================= */

.ir-dedication-result {
    display: none;

    animation:
        irDedicationResultIn .3s ease both;
}

.ir-dedication-result.is-visible {
    display: block;
}

@keyframes irDedicationResultIn {

    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


/* =========================================================
   SUCCESS BOX
   ========================================================= */

.ir-dedication-success {
    padding: 10px 0 0;

    text-align: center;
}

.ir-dedication-success-icon {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 70px;
    height: 70px;

    margin: 0 auto 15px;

    border-radius: 50%;

    background:
        rgba(232, 62, 140, .1);

    font-size: 32px;

    animation:
        irDedicationSuccessPulse 1.5s ease infinite;
}

@keyframes irDedicationSuccessPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }

}

.ir-dedication-success h3 {
    margin: 0 0 8px;

    color: #222;

    font-size: 22px;
    font-weight: 800;
}

.ir-dedication-success p {
    margin: 0 0 20px;

    color: #777;

    font-size: 13px;

    line-height: 1.8;
}


/* =========================================================
   LINK BOX
   ========================================================= */

.ir-dedication-link-box {
    display: flex;

    gap: 8px;

    padding: 8px;

    border: 1px solid #eee;

    border-radius: 14px;

    background: #f8f8f9;
}

.ir-dedication-link-box input {
    flex: 1;

    min-width: 0;

    border: 0;

    outline: 0;

    background: transparent;

    color: #555;

    font-family: Arial, sans-serif;

    font-size: 12px;

    direction: ltr;

    text-align: left;
}

.ir-dedication-copy {
    flex-shrink: 0;

    min-height: 40px;

    padding: 8px 13px;

    border: 0;

    border-radius: 10px;

    background: var(--ird-primary);

    color: #fff;

    font-family: inherit;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;
}

.ir-dedication-copy:hover {
    background: var(--ird-primary-dark);

    transform: translateY(-1px);
}


/* =========================================================
   SHARE BUTTONS
   ========================================================= */

.ir-dedication-share {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 8px;

    margin-top: 15px;
}

.ir-dedication-share a,
.ir-dedication-share button {
    display: flex;

    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 8px;

    border: 0;

    border-radius: 11px;

    color: #fff;

    font-family: inherit;

    font-size: 12px;
    font-weight: 700;

    text-decoration: none;

    cursor: pointer;

    transition:
        transform .2s ease,
        opacity .2s ease;
}

.ir-dedication-share a:hover,
.ir-dedication-share button:hover {
    opacity: .88;

    transform: translateY(-2px);
}

.ir-share-telegram {
    background: #229ed9;
}

.ir-share-whatsapp {
    background: #25d366;
}

.ir-share-sms {
    background: #666;
}

.ir-share-instagram {
    background:
        linear-gradient(
            135deg,
            #833ab4,
            #fd1d1d,
            #fcb045
        );
}


/* =========================================================
   SUCCESS CLOSE
   ========================================================= */

.ir-dedication-success-close {
    width: 100%;

    margin-top: 15px;

    min-height: 44px;

    border: 1px solid #e6e6e6;

    border-radius: 11px;

    background: #fff;

    color: #555;

    font-family: inherit;

    font-size: 13px;

    cursor: pointer;

    transition:
        background .2s ease;
}

.ir-dedication-success-close:hover {
    background: #f7f7f7;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 600px) {

    .ir-dedication-popup-box {
        width: calc(100% - 18px);

        max-height: calc(100vh - 18px);

        border-radius: 20px;
    }

    .ir-dedication-popup-header {
        padding:
            28px
            25px
            15px;
    }

    .ir-dedication-popup-header h3 {
        font-size: 21px;
    }

    .ir-dedication-form {
        padding:
            0
            20px
            25px;
    }

    .ir-dedication-themes {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .ir-dedication-theme-card {
        min-height: 95px;
    }

    .ir-dedication-actions {
        flex-direction: column;
    }

    .ir-dedication-cancel {
        width: 100%;
    }

    .ir-dedication-share {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .ir-dedication-link-box {
        flex-direction: column;
    }

    .ir-dedication-link-box input {
        width: 100%;

        min-height: 35px;

        text-align: center;
    }

    .ir-dedication-copy {
        width: 100%;
    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 380px) {

    .ir-dedication-popup-header {
        padding-top: 25px;
    }

    .ir-dedication-form {
        padding-left: 15px;
        padding-right: 15px;
    }

    .ir-dedication-themes {
        gap: 8px;
    }

    .ir-dedication-theme-card {
        padding: 9px;
    }

    .ir-dedication-theme-preview {
        width: 42px;
        height: 42px;

        font-size: 22px;
    }

}