/* ==========================================================================
   GLITZY JEWELS - VIRTUAL AR JEWELLERY TRY-ON LUXURY MODAL STYLES
   ========================================================================== */

:root {
    --ar-gold: #c5a059;
    --ar-gold-hover: #b08b44;
    --ar-gold-light: #fdfaf6;
    --ar-dark: #121316;
    --ar-dark-surface: #1c1d21;
    --ar-border: #eaeaea;
}

/* ================= TRY-ON TRIGGER BUTTONS ================= */
.btn-tryon-live {
    background: linear-gradient(135deg, #1e1f24 0%, #121316 100%);
    color: #f7e6c4 !important;
    border: 1px solid rgba(197, 160, 89, 0.4);
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    text-decoration: none !important;
    outline: none;
}

.btn-tryon-live:hover {
    background: linear-gradient(135deg, #c5a059 0%, #b08b44 100%);
    color: #ffffff !important;
    border-color: #c5a059;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(197, 160, 89, 0.35);
}

.btn-tryon-live i {
    font-size: 15px;
}

.pulse-live-badge {
    background: #e63946;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 1px;
    animation: live-pulse 1.8s infinite;
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.6);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(230, 57, 70, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0);
    }
}

/* ================= MODAL BACKDROP & CONTAINER ================= */
.ar-tryon-modal-wrapper {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ar-tryon-modal-wrapper.open {
    display: flex !important;
    opacity: 1;
}

.ar-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 14, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ar-modal-container {
    position: relative;
    width: 1100px;
    max-width: 95vw;
    height: 680px;
    max-height: 92vh;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    overflow: hidden;
    z-index: 100001;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ar-tryon-modal-wrapper.open .ar-modal-container {
    transform: scale(1);
}

.ar-close-modal-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 50;
    background: #ffffff;
    border: 1px solid var(--ar-border);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333333;
    font-size: 16px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ar-close-modal-btn:hover {
    background: var(--ar-dark);
    color: #ffffff;
    transform: rotate(90deg);
}

/* ================= LEFT SIDE: CAMERA & CANVAS ================= */
.modal-left-ar {
    flex: 1.25;
    height: 100%;
    position: relative;
    background: #08090b;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#ar-video {
    display: none;
}

#ar-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(1.14) contrast(1.04) saturate(1.05);
}

.ar-live-badge {
    position: absolute;
    top: 18px;
    left: 18px;
    background: rgba(18, 19, 22, 0.82);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
    letter-spacing: 0.5px;
}

.status-dot-green {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff88;
}

.ar-privacy-footer {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    padding: 6px 16px;
    border-radius: 16px;
    white-space: nowrap;
    z-index: 20;
}

/* ================= GUIDANCE OVERLAY ================= */
.ar-guidance-overlay {
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translate(-50%, -10px) scale(0.95);
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    width: calc(100% - 32px);
    max-width: 320px;
}

.ar-guidance-overlay.active {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    pointer-events: auto;
}

.guidance-card {
    background: rgba(14, 16, 22, 0.90);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(197, 160, 89, 0.45);
    border-radius: 16px;
    padding: 14px 18px;
    text-align: center;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.guidance-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(197, 160, 89, 0.15);
    border: 1px solid rgba(197, 160, 89, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.25);
    animation: ar-pulse-border 2s infinite;
}

@keyframes ar-pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(197, 160, 89, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(197, 160, 89, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(197, 160, 89, 0);
    }
}

.guidance-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.guidance-desc {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.guidance-tip {
    font-size: 11px;
    color: var(--ar-gold);
    font-weight: 500;
    background: rgba(197, 160, 89, 0.12);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(197, 160, 89, 0.25);
    margin-bottom: 6px;
}

.btn-guidance-retry {
    margin-top: 8px;
    background: rgba(197, 160, 89, 0.18);
    border: 1px solid rgba(197, 160, 89, 0.55);
    color: #f7e6c4;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.btn-guidance-retry:hover, .btn-guidance-retry:active {
    background: var(--ar-gold);
    color: #ffffff;
    border-color: var(--ar-gold);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(197, 160, 89, 0.4);
}

.guidance-card.error-mode {
    background: rgba(26, 12, 14, 0.94);
    border: 1px solid rgba(230, 57, 70, 0.65);
    box-shadow: 0 14px 40px rgba(230, 57, 70, 0.25), 0 0 20px rgba(0, 0, 0, 0.7);
}

.guidance-card.error-mode .guidance-icon-wrap {
    background: rgba(230, 57, 70, 0.15);
    border: 1px solid rgba(230, 57, 70, 0.5);
    box-shadow: 0 0 15px rgba(230, 57, 70, 0.35);
    animation: ar-error-pulse 2s infinite;
}

@keyframes ar-error-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.6);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(230, 57, 70, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0);
    }
}

.guidance-card.error-mode .guidance-title {
    color: #ff6b6b;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.guidance-card.error-mode .guidance-desc {
    color: #f7e6c4;
    word-break: break-word;
    font-size: 11.5px;
    line-height: 1.45;
}

.guidance-card.error-mode .btn-guidance-retry {
    background: linear-gradient(135deg, #e63946 0%, #b02a37 100%);
    border-color: #ff6b6b;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4);
}

.guidance-card.error-mode .btn-guidance-retry:hover,
.guidance-card.error-mode .btn-guidance-retry:active {
    background: linear-gradient(135deg, #ff4d5e 0%, #c82333 100%);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.6);
}

.btn-guidance-retry.loading svg,
.ar-control-btn.loading svg {
    animation: ar-spin 0.8s linear infinite;
}

/* ================= LOADING & ERROR SCREENS ================= */
.ar-overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #121316;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.ar-overlay-screen.active {
    opacity: 1;
    pointer-events: auto;
}

.ar-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(197, 160, 89, 0.2);
    border-top-color: var(--ar-gold);
    border-radius: 50%;
    animation: ar-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes ar-spin {
    to {
        transform: rotate(360deg);
    }
}

.overlay-title {
    color: #ffffff;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}

.overlay-desc {
    color: #8e929e;
    font-size: 12px;
    max-width: 280px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.retry-btn {
    background: var(--ar-gold);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.retry-btn:hover {
    background: var(--ar-gold-hover);
}

/* ================= RIGHT SIDE: PRODUCT INFO ================= */
/* ================= RIGHT SIDE: PRODUCT INFO ================= */
.modal-right-info {
    flex: 0.85;
    padding: 28px 26px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #ffffff;
}

.ar-header-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-right: 48px; /* Clearance for modal close 'X' button */
}

.btn-ar-view-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--ar-gold, #c5a059);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: all 0.25s ease;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(197, 160, 89, 0.08);
}

.btn-ar-view-details:hover {
    color: #ffffff;
    background: var(--ar-gold, #c5a059);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.25);
}

.ar-product-summary-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #faf8f5;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(197, 160, 89, 0.2);
}

.modal-thumb-box {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--ar-border);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.modal-thumb-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-head-details {
    flex: 1;
    min-width: 0;
}

.modal-product-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--ar-dark);
    margin-bottom: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qv-price-display {
    font-size: 19px;
    font-weight: 700;
    color: var(--ar-gold);
    line-height: 1.2;
}

.qv-price-display sub {
    font-size: 13px;
    font-weight: 400;
    color: #888888;
    margin-left: 6px;
}

.modal-product-desc {
    font-size: 12.5px;
    color: #666666;
    line-height: 1.55;
}

.modal-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
}

.tips-box {
    background: #fafafa;
    border: 1px solid var(--ar-border);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 11px;
    color: #777777;
    line-height: 1.5;
}

.tips-box strong {
    color: #222222;
    display: block;
    margin-bottom: 3px;
}

.ar-privacy-notice {
    font-size: 11px;
    color: #888888;
    letter-spacing: 0.2px;
}

/* ================= CONTROLS OVERLAY (FLIP & SNAPSHOT) ================= */
.ar-controls-overlay {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 35;
}

.ar-control-btn {
    background: rgba(18, 19, 22, 0.78);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(197, 160, 89, 0.4);
    color: #ffffff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    outline: none;
}

.ar-control-btn:hover {
    background: var(--ar-gold);
    color: #ffffff;
    border-color: var(--ar-gold);
    transform: scale(1.08);
    box-shadow: 0 10px 28px rgba(197, 160, 89, 0.45);
}

.ar-control-btn:active {
    transform: scale(0.95);
}

.ar-btn-capture {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #c5a059 0%, #b08b44 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 22px rgba(197, 160, 89, 0.55);
}

.ar-btn-capture:hover {
    transform: scale(1.1);
    box-shadow: 0 0 28px rgba(197, 160, 89, 0.75);
}

/* Flash Effect animation on capture */
.ar-flash-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    transition: opacity 0.15s ease-out;
}

.ar-flash-effect.flash {
    opacity: 0.85;
}

/* ================= RESPONSIVE ADAPTATIONS ================= */
@media (max-width: 860px) {
    .ar-modal-container {
        flex-direction: column;
        height: 94vh;
    }

    .modal-left-ar {
        height: 60%;
        flex: none;
    }

    .modal-right-info {
        height: 40%;
        padding: 24px 20px;
    }
}
