/* ============================================
   ElevateCV AI — AI Interview Prep Assistant CSS
   Design System: Dark SaaS Glassmorphism
   ============================================ */

/* ── Backdrop Overlay ──────────────────────── */
.ip-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 20, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms ease;
}

.ip-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* ── Modal Dialog Container ────────────────── */
.ip-modal {
    background: #0F172A;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75);
    width: 860px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    transform: scale(0.95) translateY(12px);
    transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.ip-modal-overlay.is-open .ip-modal {
    transform: scale(1) translateY(0);
}

/* ── Modal Header ──────────────────────────── */
.ip-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 26px;
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.ip-modal__title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ip-modal__title-wrap svg {
    color: #f59e0b;
}

.ip-modal__title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.ip-modal__subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin: 2px 0 0;
}

.ip-modal__close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 150ms ease;
}

.ip-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* ── Modal Toolbar (Search & Filter Tabs) ──── */
.ip-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 26px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 16px;
    flex-wrap: wrap;
}

.ip-search-box {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.ip-search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.ip-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 12px 8px 36px;
    color: #ffffff;
    font-size: 12.5px;
    font-family: inherit;
    transition: all 150ms ease;
}

.ip-search-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.ip-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ip-tab {
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
}

.ip-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.ip-tab.is-active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(236, 72, 153, 0.2));
    border-color: #f59e0b;
    color: #fbbf24;
}

/* ── Modal Body ────────────────────────────── */
.ip-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* ── Q&A Question Card ─────────────────────── */
.ip-card {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 150ms ease;
}

.ip-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.ip-card__header {
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
}

.ip-card__question {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ip-card__tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ip-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ip-badge--easy   { background: rgba(34, 197, 94, 0.18); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.ip-badge--medium { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.ip-badge--hard   { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.ip-badge--cat    { background: rgba(168, 85, 247, 0.18); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }

.ip-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-toggle-answer {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn-toggle-answer:hover {
    background: rgba(245, 158, 11, 0.25);
    color: #ffffff;
}

.ip-card__body {
    padding: 0 18px 16px;
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ip-card.is-open .ip-card__body {
    display: block;
    padding-top: 14px;
}

.ip-answer-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}

.ip-answer-box__label {
    font-size: 11px;
    font-weight: 700;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.ip-answer-box__text {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.6;
    white-space: pre-wrap;
}

.ip-tips-box {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    color: #93c5fd;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ip-tips-box svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Modal Footer Actions ──────────────────── */
.ip-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 26px;
    background: #111827;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}

.ip-footer__left, .ip-footer__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn--ip-primary {
    background: linear-gradient(135deg, #F59E0B 0%, #EC4899 100%);
    color: #ffffff;
    border: none;
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.35);
    transition: all 150ms ease;
}

.btn--ip-primary:hover {
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
}

.btn--ip-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn--ip-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* ── Shimmer Skeleton ──────────────────────── */
.ip-skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 37%, rgba(255, 255, 255, 0.04) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: 8px;
}

.ip-skeleton--card { height: 70px; margin-bottom: 12px; }

/* ── Responsive adjustments ────────────────── */
@media (max-width: 640px) {
    .ip-modal {
        width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .ip-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ip-tabs {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .ip-modal__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .ip-footer__left, .ip-footer__right {
        width: 100%;
        justify-content: space-between;
    }
}
