/**
 * Hisar Elementor Popup v3.8.0
 * Clean, Modern, Mobile-First CSS
 */

/* ============================================
   CSS RESET FOR POPUP
   ============================================ */
.hisar-popup-wrapper,
.hisar-popup-wrapper *,
.hisar-popup-wrapper *::before,
.hisar-popup-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================
   WRAPPER - FULLSCREEN FIXED
   ============================================ */
.hisar-popup-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999;
    display: none;
    justify-content: center !important;
    align-items: center !important;
    padding: 16px;
}

.hisar-popup-wrapper.is-open {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* ============================================
   OVERLAY
   ============================================ */
.hisar-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
    display: none;
}

.hisar-popup-wrapper.has-overlay .hisar-popup-overlay {
    display: block;
}

/* ============================================
   POPUP BOX
   ============================================ */
.hisar-popup-box {
    position: relative;
    z-index: 2;
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: hisarSlideUp 0.3s ease-out;
    margin: 0 auto;
    /* Center horizontally */
    left: 0;
    right: 0;
}

@keyframes hisarSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

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

/* ============================================
   HEADER - ALWAYS VISIBLE
   ============================================ */
.hisar-popup-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    padding: 16px 20px;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    min-height: 56px;
}

.hisar-popup-title {
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    flex: 1;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.hisar-popup-close {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex !important;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    margin-left: 12px;
    flex-shrink: 0;
    visibility: visible !important;
    opacity: 1 !important;
}

.hisar-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.hisar-popup-close svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ============================================
   BODY - SCROLLABLE CONTENT
   ============================================ */
.hisar-popup-body {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   POSTER IMAGE
   ============================================ */
.hisar-popup-poster {
    width: 100%;
    margin-bottom: 16px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    padding-top: 56.25%;
    /* 16:9 */
    background: #f1f5f9;
}

.hisar-popup-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   DESCRIPTION
   ============================================ */
.hisar-popup-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.hisar-popup-form {
    display: block;
}

.hisar-form-group {
    margin-bottom: 16px;
}

.hisar-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.hisar-form-input,
.hisar-form-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    color: #1f2937;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.hisar-form-input:focus,
.hisar-form-select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.hisar-form-input::placeholder {
    color: #9ca3af;
}

.hisar-form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

/* ============================================
   FORM ROW (TWO COLUMNS)
   ============================================ */
.hisar-form-row {
    display: flex;
    gap: 12px;
}

.hisar-form-half {
    flex: 1;
    min-width: 0;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.hisar-popup-submit {
    width: 100%;
    padding: 14px 20px;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.hisar-popup-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.hisar-popup-submit:active {
    transform: translateY(0);
}

.hisar-popup-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.hisar-popup-submit svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ============================================
   MESSAGES
   ============================================ */
.hisar-form-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.hisar-form-message.show {
    display: block;
}

.hisar-form-message.success {
    background: #dcfce7;
    color: #166534;
}

.hisar-form-message.error {
    background: #fee2e2;
    color: #dc2626;
}

/* ============================================
   ELEMENTOR EDITOR MODE
   ============================================ */
.elementor-editor-active .hisar-popup-wrapper {
    position: relative !important;
    display: block !important;
    height: auto !important;
    padding: 20px !important;
    z-index: 1 !important;
}

.elementor-editor-active .hisar-popup-overlay {
    display: none !important;
}

.elementor-editor-active .hisar-popup-box {
    position: relative !important;
    max-height: none !important;
    margin: 0 auto !important;
    animation: none !important;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media screen and (max-width: 480px) {
    .hisar-popup-wrapper {
        padding: 12px;
    }

    .hisar-popup-box {
        max-width: 100%;
        max-height: 94vh;
        border-radius: 14px;
    }

    /* HEADER - MOBILE */
    .hisar-popup-header {
        padding: 14px 16px;
        min-height: 52px;
    }

    .hisar-popup-title {
        font-size: 15px;
    }

    .hisar-popup-close {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .hisar-popup-close svg {
        width: 16px;
        height: 16px;
    }

    /* BODY - MOBILE */
    .hisar-popup-body {
        padding: 16px;
        max-height: calc(94vh - 52px);
    }

    .hisar-popup-poster {
        margin-bottom: 12px;
        border-radius: 8px;
    }

    .hisar-popup-desc {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .hisar-form-group {
        margin-bottom: 12px;
    }

    .hisar-form-label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .hisar-form-input,
    .hisar-form-select {
        padding: 11px 12px;
        font-size: 14px;
        border-radius: 8px;
        min-height: 44px;
    }

    .hisar-form-row {
        gap: 10px;
    }

    .hisar-popup-submit {
        padding: 14px 16px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
        min-height: 48px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: auto !important;
        position: relative !important;
        overflow: visible !important;
    }

    .hisar-popup-submit svg {
        width: 18px !important;
        height: 18px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .hisar-popup-submit span {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* ============================================
   SMALL MOBILE
   ============================================ */
@media screen and (max-width: 360px) {
    .hisar-popup-wrapper {
        padding: 8px;
    }

    .hisar-popup-box {
        max-height: 96vh;
    }

    .hisar-popup-header {
        padding: 12px 14px;
        min-height: 48px;
    }

    .hisar-popup-title {
        font-size: 14px;
    }

    .hisar-popup-close {
        width: 30px;
        height: 30px;
        min-width: 30px;
    }

    .hisar-popup-body {
        padding: 14px;
        max-height: calc(96vh - 48px);
    }

    .hisar-form-label {
        font-size: 11px;
    }

    .hisar-form-input,
    .hisar-form-select {
        padding: 10px;
        font-size: 13px;
    }

    .hisar-popup-submit {
        padding: 12px;
        font-size: 13px;
    }
}

/* ============================================
   FORCE VISIBILITY (THEME OVERRIDE)
   ============================================ */
.hisar-popup-wrapper .hisar-popup-box .hisar-popup-header {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 48px !important;
    overflow: visible !important;
    position: relative !important;
    transform: none !important;
    clip: auto !important;
    -webkit-clip-path: none !important;
    clip-path: none !important;
}

.hisar-popup-wrapper .hisar-popup-box .hisar-popup-header .hisar-popup-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    clip: auto !important;
}

.hisar-popup-wrapper .hisar-popup-box .hisar-popup-header .hisar-popup-close {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
}

/* Z-index safety */
.hisar-popup-wrapper.is-open {
    z-index: 9999999 !important;
}

.hisar-popup-wrapper.is-open .hisar-popup-box {
    z-index: 10000000 !important;
}

/* ============================================
   FORCE SUBMIT BUTTON VISIBILITY
   ============================================ */
.hisar-popup-wrapper .hisar-popup-box .hisar-popup-submit {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    height: auto !important;
    width: 100% !important;
    overflow: visible !important;
    clip: auto !important;
    -webkit-clip-path: none !important;
    clip-path: none !important;
    transform: none !important;
}

.hisar-popup-wrapper .hisar-popup-box .hisar-popup-submit svg,
.hisar-popup-wrapper .hisar-popup-box .hisar-popup-submit span {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

/* PULSE Animation */
@keyframes hisarPulse {

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

    50% {
        transform: scale(1.05);
    }
}

.hisar-btn-anim-pulse {
    animation: hisarPulse 2s ease-in-out infinite;
}

/* BOUNCE Animation */
@keyframes hisarBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.hisar-btn-anim-bounce {
    animation: hisarBounce 1.5s ease-in-out infinite;
}

/* SHAKE Animation */
@keyframes hisarShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.hisar-btn-anim-shake {
    animation: hisarShake 0.8s ease-in-out infinite;
}

/* GLOW Animation */
@keyframes hisarGlow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
    }

    50% {
        box-shadow: 0 4px 30px rgba(5, 150, 105, 0.8), 0 0 20px rgba(5, 150, 105, 0.6);
    }
}

.hisar-btn-anim-glow {
    animation: hisarGlow 2s ease-in-out infinite;
}

/* SCALE Animation */
@keyframes hisarScale {

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

    50% {
        transform: scale(1.08);
    }
}

.hisar-btn-anim-scale {
    animation: hisarScale 1.2s ease-in-out infinite;
}

/* NONE - No animation */
.hisar-btn-anim-none {
    animation: none;
}