/* Love Match Tool Frontend */
.lmt-wrap {
    --bg1: #ff4d7d;
    --bg2: #ff8f4f;
    --bg3: #ff7ab8;
    --card: rgba(255, 255, 255, 0.16);
    --line: rgba(255, 255, 255, 0.3);
    --text: #2f1231;
    --accent: #fff4fb;
    --shadow: 0 22px 45px rgba(74, 18, 54, 0.22);
    --radius: 22px;
    width: min(980px, 95%);
    margin: 0 auto;
    font-family: "Poppins", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
}

.lmt-card {
    position: relative;
    overflow: hidden;
    padding: 2rem;
    border-radius: var(--radius);
    background: linear-gradient(130deg, var(--bg1), var(--bg3), var(--bg2));
    box-shadow: var(--shadow);
}

.lmt-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.42), transparent 40%);
    pointer-events: none;
}

.lmt-card > * {
    position: relative;
    z-index: 2;
}

.lmt-orbit {
    position: absolute;
    right: -80px;
    top: -70px;
    width: 220px;
    height: 220px;
    border: 2px dashed rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    animation: spin 12s linear infinite;
}

.lmt-sparkles {
    position: absolute;
    left: -12px;
    top: 10px;
    width: 100%;
    pointer-events: none;
}

.lmt-sparkles span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    opacity: 0.85;
    animation: float 4s infinite ease-in-out;
}

.lmt-sparkles span:nth-child(1) {
    left: 10%;
    top: 12px;
    animation-delay: 0.2s;
}

.lmt-sparkles span:nth-child(2) {
    left: 65%;
    top: 25px;
    animation-delay: 0.9s;
    animation-duration: 5s;
}

.lmt-sparkles span:nth-child(3) {
    left: 45%;
    top: 52px;
    animation-delay: 0.5s;
    animation-duration: 4.2s;
}

.lmt-sparkles span:nth-child(4) {
    left: 80%;
    top: 70px;
    animation-delay: 1.2s;
    animation-duration: 6s;
}

.lmt-header {
    text-align: center;
    margin-bottom: 1.2rem;
}

.lmt-header h2 {
    margin: 0;
    color: #fff;
    letter-spacing: 0.2px;
}

.lmt-header p {
    color: var(--accent);
    margin: 0.4rem 0 0;
}

.lmt-badge {
    display: inline-block;
    margin: 0 auto 0.8rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--line);
}

.lmt-form {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
    backdrop-filter: blur(5px);
    display: grid;
    gap: 0.8rem;
}

.lmt-field {
    display: grid;
    gap: 0.35rem;
    color: #fff;
    font-size: 0.95rem;
}

.lmt-field span {
    font-weight: 600;
}

.lmt-field input {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: #2d122c;
}

.lmt-form .lmt-btn {
    margin-top: 0.2rem;
}

.lmt-btn,
.lmt-share-btn {
    border: 0;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: #6a1242;
    cursor: pointer;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lmt-btn:hover,
.lmt-share-btn:hover,
.lmt-btn:focus-visible,
.lmt-share-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(61, 14, 47, 0.25);
}

.lmt-btn {
    width: 100%;
    letter-spacing: 0.3px;
}

.lmt-btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.62);
    color: #fff;
}

.lmt-btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lmt-btn-secondary {
    background: #fff3fc;
    color: #611748;
}

.lmt-btn-loading {
    position: relative;
    pointer-events: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.lmt-btn-loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 0.75s linear infinite;
}

.lmt-error {
    margin: 0.4rem 0 0;
    min-height: 1.2rem;
    color: #ffe8ee;
    font-weight: 600;
}

.lmt-result {
    margin-top: 1.2rem;
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
}

.lmt-result.is-visible {
    display: block;
}

.lmt-progress-wrap {
    display: grid;
    gap: 0.8rem;
    align-items: center;
}

.lmt-progress-bar {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
    overflow: hidden;
}

.lmt-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #fff, #ffd6ec);
    transition: width 0.75s cubic-bezier(0.26, 1, 0.48, 1);
}

.lmt-score {
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid var(--line);
    border-radius: 10px;
    width: fit-content;
    padding: 0.35rem 0.8rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.lmt-meta p {
    margin: 0.55rem 0;
    color: #fff;
}

.lmt-breakdown {
    color: #fff6ff;
    line-height: 1.45;
}

.lmt-rashi-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.lmt-share {
    margin-top: 1rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.lmt-share-btn {
    text-decoration: none;
}

.lmt-result-pill {
    margin: 0;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    width: fit-content;
    font-size: 0.8rem;
    margin-bottom: 0.7rem;
    border: 1px solid var(--line);
}

.lmt-preview-wrap {
    margin-top: 0.75rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px dashed rgba(255, 255, 255, 0.45);
}

.lmt-preview-wrap img {
    width: 100%;
    display: block;
    max-height: 260px;
    object-fit: cover;
}

.lmt-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

.lmt-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.lmt-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(24, 10, 31, 0.66);
}

.lmt-modal-box {
    position: relative;
    width: min(520px, 100%);
    background: linear-gradient(160deg, #ffe4f2, #ffbfd9 40%, #ffd9bb);
    border-radius: 18px;
    padding: 1.3rem;
    border: 1px solid rgba(255, 255, 255, 0.46);
    box-shadow: 0 18px 40px rgba(43, 10, 39, 0.35);
}

.lmt-modal-close {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    border: 0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.74);
    color: #59143f;
}

.lmt-modal-content h3 {
    margin: 0.2rem 0 0.8rem;
    color: #581543;
}

.lmt-modal-score {
    font-size: 2.2rem;
    color: #791855;
    font-weight: 800;
    margin: 0;
}

.lmt-modal-cat,
.lmt-modal-rashi,
.lmt-modal-breakdown,
.lmt-modal-rel {
    margin: 0.3rem 0;
    color: #5f153f;
}

.lmt-modal-breakdown {
    color: #7f2759;
}

.lmt-modal-actions {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin: 0.8rem 0;
}

.lmt-modal .lmt-share-btn {
    background: #fff;
}

.lmt-modal .lmt-btn {
    width: 100%;
    text-align: center;
}

@media (max-width: 720px) {
    .lmt-modal-box {
        width: 100%;
        max-height: calc(100vh - 3rem);
        overflow: auto;
    }
}

@media (max-width: 720px) {
    .lmt-card {
        padding: 1.1rem;
    }

    .lmt-form {
        grid-template-columns: 1fr;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
        opacity: 0;
    }
    50% {
        transform: translateY(-14px);
        opacity: 1;
    }
}

.lmt-calc-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: rgba(15, 5, 20, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    border-radius: var(--radius);
    overflow: hidden;
}

.lmt-calc-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.lmt-calc-content {
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lmt-magic-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -75px;
    margin-left: -75px;
    width: 150px;
    height: 150px;
    border: 2px dashed #ff1744;
    border-radius: 50%;
    animation: spin-fast 1s linear infinite;
    box-shadow: 0 0 20px #ff1744;
}

.lmt-magic-circle.inner {
    margin-top: -50px;
    margin-left: -50px;
    width: 100px;
    height: 100px;
    border: 2px dotted #d500f9;
    animation: spin-fast-reverse 0.7s linear infinite;
    box-shadow: 0 0 15px #d500f9;
}

.lmt-calc-icon {
    font-size: 3rem;
    color: #fff;
    text-shadow: 0 0 10px #ff0000;
    animation: pulse-scary 0.5s ease-in-out infinite alternate;
    z-index: 2;
    line-height: 1;
}

.lmt-calc-text {
    margin-top: 110px;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 2px 2px 0px #ff0000, -2px -2px 0px #0000ff;
    animation: glitch-text 0.2s infinite;
}

@keyframes spin-fast {
    to { transform: rotate(360deg); }
}
@keyframes spin-fast-reverse {
    to { transform: rotate(-360deg); }
}
@keyframes pulse-scary {
    from { transform: scale(1); filter: hue-rotate(0deg); }
    to { transform: scale(1.3); filter: hue-rotate(90deg); }
}
@keyframes glitch-text {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}
