:root {
    --accent: #FF0080;
    --accent-secondary: #7A00FF;
    --bg-light: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-border: rgba(255, 0, 128, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #fafafa;
    background-image: radial-gradient(circle at 2px 2px, rgba(255, 0, 128, 0.05) 1px, transparent 0);
    background-size: 40px 40px;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; }

/* Header & Hero */
.hero-compact { text-align: center; margin-bottom: 3rem; }
.brand-logo-container { margin-bottom: 1rem; display: flex; justify-content: center; }
.brand-logo { width: 80px; height: 80px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(255, 0, 128, 0.2)); }
.brand-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(255, 0, 128, 0.05); padding: 0.5rem 1.2rem;
    border-radius: 50px; color: var(--accent); font-weight: 800;
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 1rem; border: 1px solid rgba(255, 0, 128, 0.1);
}
h1 { font-family: 'Outfit', sans-serif; font-size: 3.5rem; font-weight: 900; color: #0f172a; margin-bottom: 0.5rem; }
h1 span { color: var(--accent); }
.hero-subtitle { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; line-height: 1.6; font-weight: 600; }

/* Tabs & Input */
.tabs { display: flex; gap: 0.75rem; justify-content: center; margin-bottom: 1.5rem; }
.tab-btn {
    padding: 0.6rem 1.5rem; border: none; background: #f1f5f9;
    color: var(--text-muted); font-weight: 700; cursor: pointer;
    border-radius: 12px; transition: all 0.3s;
}
.tab-btn.active { background: var(--accent); color: white; box-shadow: 0 5px 15px rgba(255, 0, 128, 0.2); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.4s ease-out; }

.engine-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.engine-btn {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.5rem; background: white; border: 2px solid #f1f5f9;
    border-radius: 20px; cursor: pointer; transition: all 0.3s;
}
.engine-btn.active { border-color: var(--accent); background: rgba(255, 0, 128, 0.02); }
.engine-btn .btn-content { display: flex; align-items: center; gap: 0.75rem; }
.engine-btn.active span { color: #0f172a; font-weight: 800; }

.input-section { margin-bottom: 3rem; }
.glass-card { background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 32px; padding: 2.5rem; box-shadow: 0 20px 40px rgba(0,0,0,0.03); }
.input-group { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
input, textarea { flex: 1; padding: 1.2rem 1.5rem; border-radius: 18px; border: 2px solid #f1f5f9; font-size: 1rem; font-family: inherit; transition: all 0.3s; background: #f8fafc; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); background: white; }
textarea { min-height: 100px; width: 100%; margin-bottom: 1rem; }

.primary-btn {
    padding: 1rem 2.5rem; border-radius: 18px; border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: white; font-weight: 800; cursor: pointer;
    display: flex; align-items: center; gap: 0.75rem; transition: all 0.3s;
    box-shadow: 0 10px 25px rgba(255, 0, 128, 0.2);
}
.primary-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(255, 0, 128, 0.3); }

/* Results Layout */
.results-hidden { display: none !important; }
.results-visible { 
    display: block !important; 
    animation: premiumFade 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards; 
}

@keyframes premiumFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-top-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.5rem; margin-bottom: 2rem; }
.chart-card { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 450px; }
.chart-container { width: 100%; max-width: 380px; aspect-ratio: 1/1; position: relative; }

.profile-card { display: flex; flex-direction: column; padding: 2.5rem; text-align: left; }
.profile-header { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; width: 100%; }
.profile-circle { width: 65px; height: 65px; background: linear-gradient(135deg, var(--accent), var(--accent-secondary)); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 900; font-size: 1.5rem; flex-shrink: 0; }
.profile-info { flex-grow: 1; }
.profile-info h2 { font-size: 1.8rem; font-weight: 900; color: #0f172a; }
.profile-info p { color: var(--accent); font-weight: 700; font-size: 1rem; }

.profile-summary { font-size: 1rem; line-height: 1.8; color: #475569; margin-bottom: 1.5rem; }
.tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag { background: rgba(255, 0, 128, 0.05); color: var(--accent); padding: 0.4rem 1rem; border-radius: 50px; font-size: 0.75rem; font-weight: 800; border: 1px solid rgba(255, 0, 128, 0.1); }

/* Trait Grid */
.traits-narrative-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 1rem; }
.trait-narrative-card { background: white; padding: 2rem; border-radius: 24px; border: 1px solid #f1f5f9; }
.trait-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.trait-title-wrapper { display: flex; align-items: center; gap: 0.5rem; }
.trait-title { font-weight: 800; font-size: 1.1rem; color: #0f172a; }
.trait-score { color: var(--accent); font-weight: 800; font-size: 1.1rem; }
.mini-bar { height: 6px; background: #f1f5f9; border-radius: 10px; margin-bottom: 1.25rem; overflow: hidden; }
.bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-secondary)); }
.trait-desc { font-size: 0.85rem; color: #64748b; line-height: 1.6; }

/* Metadata & Artifacts */
#metadata-display { 
    margin-top: 1.5rem; 
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    border-radius: 20px; 
    padding: 1.5rem; 
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#metadata-wrapper {
    position: relative;
    max-height: 200px; /* Fixed height ~5cm */
    overflow: hidden;
    transition: max-height 0.5s ease;
}

#metadata-display.expanded #metadata-wrapper {
    max-height: 2000px;
}

#metadata-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(transparent, #f8fafc);
    pointer-events: none;
    transition: opacity 0.3s;
}

#metadata-display.expanded #metadata-fade {
    opacity: 0;
}

.view-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.view-more-btn:hover { background: rgba(255, 0, 128, 0.05); }

.view-more-btn i { transition: transform 0.3s; }
#metadata-display.expanded .view-more-btn i { transform: rotate(180deg); }

.metadata-hidden { display: none !important; }
.metadata-visible { display: block !important; }
.metadata-header { display: flex; align-items: center; gap: 0.5rem; color: var(--accent); font-weight: 800; font-size: 0.75rem; text-transform: uppercase; margin-bottom: 0.75rem; }
#metadata-content { font-family: 'Inter', monospace; font-size: 0.85rem; color: #475569; white-space: pre-wrap; line-height: 1.5; }

/* Tooltips */
.info-trigger { position: relative; cursor: help; }
.info-trigger i { width: 18px; height: 18px; opacity: 0.4; }
.tooltip {
    position: absolute; bottom: 140%; right: -10px; width: 300px;
    background: white; padding: 1.25rem; border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15); border: 1px solid var(--accent);
    font-size: 0.8rem; line-height: 1.6; opacity: 0; pointer-events: none; transition: all 0.3s; z-index: 100;
}
.info-trigger:hover .tooltip { opacity: 1; transform: translateY(-5px); }

.info-trigger-mini { position: relative; cursor: help; color: var(--accent); opacity: 0.6; }
.info-trigger-mini i { width: 14px; height: 14px; }
.tooltip-mini {
    position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); width: 220px;
    background: white; padding: 1rem; border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid var(--accent);
    font-size: 0.75rem; opacity: 0; pointer-events: none; transition: all 0.3s; z-index: 100;
}
.info-trigger-mini:hover .tooltip-mini { opacity: 1; transform: translateY(-5px); }

/* Status Loader */
#status-message { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.5rem; }
.status-hidden { display: none !important; }
.loader { width: 20px; height: 20px; border: 3px solid rgba(255, 0, 128, 0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 768px) {
    .results-top-grid { grid-template-columns: 1fr; }
    .engine-selector { grid-template-columns: 1fr; }
    h1 { font-size: 2.2rem; letter-spacing: -1px; }
    .glass-card { padding: 1.5rem; }
    .input-group { flex-direction: column; }
    .primary-btn { width: 100%; justify-content: center; padding: 1.2rem; }
    .chart-card { min-height: 350px; padding: 1rem; }
    .profile-header { flex-direction: column; text-align: center; }
    .profile-info { margin: 1rem 0; }
    .trust-grid { grid-template-columns: 1fr; }
}

/* Trust & Security Section */
.trust-section {
    margin-bottom: 4rem;
    animation: fadeIn 1s ease-out;
}
.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.trust-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 0, 128, 0.05);
    padding: 2rem;
    border-radius: 24px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.trust-card:hover {
    background: white;
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(255, 0, 128, 0.05);
    border-color: rgba(255, 0, 128, 0.1);
}
.trust-card i {
    color: var(--accent);
    margin-bottom: 1.25rem;
    width: 32px;
    height: 32px;
}
.trust-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: #0f172a;
}
.trust-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer {
    text-align: center;
    padding: 3rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.03);
    color: var(--text-muted);
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.3);
}
