/* Dream-Girl Chat - Profile Overlay UI
   Mobile-first, matches chat.css variables.
*/

:root {
    --dgc-profile-card: rgba(10, 10, 14, 0.55);
    --dgc-profile-card-2: rgba(16, 16, 22, 0.72);
    --dgc-profile-border: rgba(255, 255, 255, 0.14);
    --dgc-profile-shadow: 0 18px 70px rgba(0, 0, 0, 0.55);
    --dgc-profile-radius: 28px;
    --dgc-profile-blur: 18px;
}

/* Wrap chat + profile without changing chat internals */
.dgc-profile-shell {
    width: 100%;
    max-width: 100%;
    margin: 20px auto;
}

.dgc-profile-shell .dgc-chat-container {
    margin: 0 auto; /* avoid double margin inside wrapper */
}

.dgc-profile-layout {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.dgc-profile-stage {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* "Profile" button shown on chat view */
.dgc-profile-back-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10001;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--dgc-profile-border);
    background: rgba(0,0,0,0.35);
    color: var(--text-color, #fff);
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    backdrop-filter: blur(var(--dgc-profile-blur));
    -webkit-backdrop-filter: blur(var(--dgc-profile-blur));
}

.dgc-profile-back-btn:hover {
    background: rgba(0,0,0,0.5);
}

.dgc-profile-shell.dgc-profile-open .dgc-profile-back-btn {
    display: none;
}

/* Make header identity feel clickable */
.dgc-profile-shell .dgc-avatar-container,
.dgc-profile-shell .dgc-chatbot-name {
    cursor: pointer;
}

/* Overlay */
.dgc-profile-overlay {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.dgc-profile-shell.dgc-profile-open .dgc-profile-overlay {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Overlay mode (inside chat): don't show a second portrait image */
.dgc-profile-shell.dgc-profile-mode-overlay .dgc-profile-avatar {
    display: none;
}

/* Page/shortcode mode: show profile content without absolute overlay mechanics */
.dgc-profile-shell.dgc-profile-page {
    max-width: 100%;
    margin: 18px auto;
}

.dgc-profile-shell.dgc-profile-page .dgc-profile-layout {
    gap: 16px;
}

.dgc-profile-shell.dgc-profile-page .dgc-profile-stage {
    width: 100%;
}

.dgc-profile-shell.dgc-profile-page .dgc-profile-overlay {
    position: relative;
    inset: auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.dgc-profile-shell.dgc-profile-page .dgc-profile-back-btn,
.dgc-profile-shell.dgc-profile-page .dgc-profile-cta {
    display: none;
}

.dgc-profile-shell.dgc-profile-page .dgc-profile-details {
    display: block;
    max-width: 100%;
    padding: 0 10px;
}

/* Dashboard mode: full-width "dating profile" layout */
.dgc-profile-shell.dgc-profile-mode-dashboard {
    margin: 0;
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-top {
    display: grid;
    grid-template-columns: minmax(0, clamp(280px, 35vw, 360px)) minmax(0, 1fr);
    gap: clamp(10px, 2vw, 14px);
    align-items: start;
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-left {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 2vw, 12px);
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-right {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 2vw, 12px);
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-portrait {
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: clamp(300px, 50vh, 480px);
    border-radius: 26px;
    border: 1px solid var(--dgc-profile-border);
    object-fit: cover;
    background: rgba(255,255,255,0.06);
    box-shadow: var(--dgc-profile-shadow);
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-portrait--empty {
    min-height: 420px;
    background:
        radial-gradient(900px 600px at 20% 10%, rgba(255, 20, 147, 0.22), transparent 55%),
        radial-gradient(800px 500px at 85% 30%, rgba(138, 43, 226, 0.18), transparent 58%),
        rgba(0,0,0,0.35);
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-summary {
    padding: clamp(12px, 2vw, 16px);
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-summary .dgc-profile-name {
    margin: 0;
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-summary .dgc-profile-badge {
    flex: 0 0 auto;
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-summary .dgc-profile-tagline {
    margin-top: 10px;
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-details {
    margin-top: 14px;
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-details h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-media {
    padding: clamp(10px, 2vw, 14px);
}

.dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-bio {
    margin-top: 14px;
}

@media (max-width: 900px) {
    .dgc-profile-shell.dgc-profile-mode-dashboard .dgc-profile-dashboard-top {
        grid-template-columns: 1fr;
    }
}

/* Dim the chat underneath in open state without altering layout */
.dgc-profile-shell.dgc-profile-open .dgc-chat-container {
    filter: saturate(0.9);
}

.dgc-profile-overlay-inner {
    width: 100%;
    height: 100%;
}

.dgc-profile-cover {
    width: 100%;
    height: 100%;
    border-radius: 30px; /* match chat container */
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: var(--dgc-profile-shadow);
    position: relative;
}

.dgc-profile-cover video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dgc-profile-cover-media {
    position: absolute;
    inset: 0;
}

.dgc-profile-cover-scrim {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 600px at 20% 10%, rgba(255, 20, 147, 0.30), transparent 55%),
        radial-gradient(800px 500px at 85% 30%, rgba(138, 43, 226, 0.26), transparent 58%),
        linear-gradient(to bottom, rgba(0,0,0,0.10), rgba(0,0,0,0.75) 62%, rgba(0,0,0,0.92));
}

.dgc-profile-cover-content {
    position: absolute;
    inset: 0;
    padding: clamp(12px, 3vw, 16px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dgc-profile-toprow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dgc-profile-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.30);
    color: var(--text-color, #fff);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    backdrop-filter: blur(var(--dgc-profile-blur));
    -webkit-backdrop-filter: blur(var(--dgc-profile-blur));
}

.dgc-profile-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: linear-gradient(135deg, rgba(255,20,147,0.75), rgba(138,43,226,0.70));
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.dgc-profile-cta:hover {
    filter: brightness(1.05);
}

.dgc-profile-identity {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    align-items: center;
}

.dgc-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.20);
    object-fit: cover;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    background: rgba(255,255,255,0.06);
}

.dgc-profile-name {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
    color: #fff;
}

.dgc-profile-meta {
    margin-top: 3px;
    font-size: 13px;
    color: rgba(255,255,255,0.86);
}

.dgc-profile-tagline {
    grid-column: 1 / -1;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(0,0,0,0.32);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.92);
    backdrop-filter: blur(var(--dgc-profile-blur));
    -webkit-backdrop-filter: blur(var(--dgc-profile-blur));
}

.dgc-profile-quick {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    padding: 0 14px;
}

.dgc-profile-quick-card {
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(0,0,0,0.32);
    padding: 12px;
    backdrop-filter: blur(var(--dgc-profile-blur));
    -webkit-backdrop-filter: blur(var(--dgc-profile-blur));
}

.dgc-profile-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dgc-profile-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.92);
    font-size: 12px;
    white-space: nowrap;
}

/* Details panel (mobile: below; desktop: sidebar) */
.dgc-profile-details {
    width: 100%;
    max-width: 720px;
    padding: 0 10px;
    display: none;
}

.dgc-profile-shell.dgc-profile-open .dgc-profile-details {
    display: block;
}

.dgc-profile-panel {
    border-radius: var(--dgc-profile-radius);
    border: 1px solid var(--dgc-profile-border);
    background: var(--dgc-profile-card);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    padding: 14px 14px;
    color: rgba(255,255,255,0.92);
    backdrop-filter: blur(var(--dgc-profile-blur));
    -webkit-backdrop-filter: blur(var(--dgc-profile-blur));
    margin-bottom: 12px;
}

.dgc-profile-panel h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
}

.dgc-profile-panel p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255,255,255,0.90);
}

.dgc-profile-grid-panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.dgc-profile-media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.dgc-profile-media-grid img,
.dgc-profile-media-grid video {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
}

.dgc-profile-media-grid img,
.dgc-profile-media-grid video {
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
    will-change: transform;
    position: relative;
}

/* Hover zoom (desktop). Click selection is handled by JS. */
@media (hover: hover) and (pointer: fine) {
    .dgc-profile-media-grid img:hover,
    .dgc-profile-media-grid video:hover {
        transform: scale(1.08);
        z-index: 5;
        box-shadow: 0 14px 40px rgba(0,0,0,0.55);
        border-color: rgba(255,255,255,0.22);
    }
}

.dgc-profile-media-grid .dgc-media-zoomed {
    transform: scale(1.9);
    z-index: 10;
    box-shadow: 0 18px 70px rgba(0,0,0,0.6);
}

/* Desktop: side-by-side layout */
@media (min-width: 960px) {
    .dgc-profile-layout {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
    }

    /* Shortcode/page mode should fill the containing column */
    .dgc-profile-shell.dgc-profile-page .dgc-profile-layout {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }

    .dgc-profile-stage {
        width: auto;
    }

    .dgc-profile-details {
        display: block;
        max-width: 420px;
        padding: 0;
    }

    .dgc-profile-shell.dgc-profile-page .dgc-profile-details {
        max-width: 100%;
        width: 100%;
        padding: 0 10px;
    }

    .dgc-profile-shell:not(.dgc-profile-open) .dgc-profile-details {
        display: none;
    }
}

/* Small phones: keep everything usable */
@media (max-width: 420px) {
    .dgc-profile-back-btn {
        top: 10px;
        left: 10px;
        padding: 7px 10px;
    }

    .dgc-profile-name {
        font-size: 18px;
    }
}

/* Fullscreen media viewer (profile page) */
.dgc-profile-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.92);
}

.dgc-profile-fullscreen .dgc-profile-fullscreen-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.dgc-profile-fullscreen .dgc-profile-fullscreen-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 28px;
    line-height: 42px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dgc-profile-fullscreen .dgc-profile-fullscreen-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dgc-profile-fullscreen img,
.dgc-profile-fullscreen video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 18px 70px rgba(0, 0, 0, 0.65);
}

.dgc-profile-fullscreen.is-cover img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    border-radius: 0;
}

.dgc-profile-fullscreen video {
    width: min(1100px, 100%);
    height: auto;
}
