/**
 * Media Semesta Community Add-on - Frontend Styles
 * Zero-Emoji Standard | Contributor Profile Box, Legal Disclaimer & Topbar Integration
 */

/* ==========================================================================
   1. Topbar Contributor Entry Point
   ========================================================================== */
.ms-topbar-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.ms-topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fp-text-secondary, #5a5a72);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.ms-topbar-link i {
    font-size: 13px;
}

.ms-topbar-link:hover {
    color: var(--fp-accent-primary, #e63946);
}

.ms-topbar-link--cta {
    background: rgba(230, 57, 70, 0.08);
    color: var(--fp-accent-primary, #e63946);
    padding: 3px 9px;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid rgba(230, 57, 70, 0.2);
}

.ms-topbar-link--cta:hover {
    background: var(--fp-accent-primary, #e63946);
    color: #ffffff;
}

.ms-topbar-link--write {
    color: var(--fp-accent-primary, #e63946);
    font-weight: 600;
}

.ms-topbar-link--logout {
    opacity: 0.7;
}

.ms-topbar-link--logout:hover {
    opacity: 1;
    color: #dc2626;
}

/* ==========================================================================
   2. Contributor Author Box (Single Post)
   ========================================================================== */
.ms-contributor-box {
    display: flex;
    gap: 20px;
    background: var(--fp-bg-secondary, #f8fafc);
    border: 1px solid var(--fp-border-color, #e2e8f0);
    border-radius: 12px;
    padding: 24px;
    margin: 32px 0 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ms-contributor-box:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.ms-contributor-box__avatar-wrap {
    flex-shrink: 0;
}

.ms-contributor-box__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.ms-contributor-box__details {
    flex: 1;
    min-width: 0;
}

.ms-contributor-box__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.ms-contributor-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.ms-contributor-badge i {
    font-size: 10px;
}

.ms-contributor-box__name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.ms-contributor-box__name a {
    color: var(--fp-text-primary, #1e293b);
    text-decoration: none;
}

.ms-contributor-box__name a:hover {
    color: var(--fp-accent-primary, #e63946);
}

.ms-contributor-box__location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--fp-text-muted, #64748b);
    margin-top: 2px;
}

.ms-contributor-box__socials {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ms-contributor-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--fp-border-color, #e2e8f0);
    color: var(--fp-text-secondary, #64748b);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s ease;
}

.ms-contributor-social-link:hover {
    background: var(--fp-accent-primary, #e63946);
    border-color: var(--fp-accent-primary, #e63946);
    color: #ffffff;
    transform: translateY(-2px);
}

.ms-contributor-box__bio {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--fp-text-secondary, #475569);
    margin-bottom: 14px;
}

.ms-contributor-box__bio p {
    margin: 0;
}

.ms-contributor-box__footer {
    border-top: 1px solid var(--fp-border-color, #e2e8f0);
    padding-top: 10px;
}

.ms-contributor-box__all-posts-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fp-accent-primary, #e63946);
    text-decoration: none;
    transition: gap 0.15s ease;
}

.ms-contributor-box__all-posts-link:hover {
    gap: 10px;
    text-decoration: underline;
}

/* ==========================================================================
   3. Legal Disclaimer Box (Klausul Tanggung Jawab Pers)
   ========================================================================== */
.ms-legal-disclaimer-box {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #3b82f6;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin: 20px 0 28px;
}

.ms-legal-disclaimer__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.ms-legal-disclaimer__content {
    flex: 1;
}

.ms-legal-disclaimer__title {
    margin: 0 0 5px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.01em;
}

.ms-legal-disclaimer__text {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #64748b;
}

/* ==========================================================================
   4. Contributor CTA Banner
   ========================================================================== */
.ms-cta-banner {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 30px;
    margin: 36px 0;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.ms-cta-banner__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.ms-cta-banner__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 10px;
    color: #ffffff;
}

.ms-cta-banner__desc {
    font-size: 14px;
    line-height: 1.6;
    color: #94a3b8;
    margin: 0 0 20px;
    max-width: 680px;
}

.ms-cta-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ms-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.ms-cta-btn--primary {
    background: var(--fp-accent-primary, #e63946);
    color: #ffffff;
}

.ms-cta-btn--primary:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

.ms-cta-btn--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ms-cta-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* ==========================================================================
   5. Dark Mode Overrides
   ========================================================================== */
[data-theme="dark"] .ms-topbar-link {
    color: var(--fp-text-secondary, #94a3b8);
}

[data-theme="dark"] .ms-topbar-link--cta {
    background: rgba(230, 57, 70, 0.15);
    border-color: rgba(230, 57, 70, 0.35);
}

[data-theme="dark"] .ms-contributor-box {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .ms-contributor-box:hover {
    border-color: #475569;
}

[data-theme="dark"] .ms-contributor-box__avatar {
    border-color: #0f172a;
}

[data-theme="dark"] .ms-contributor-box__name a {
    color: #f1f5f9;
}

[data-theme="dark"] .ms-contributor-box__bio {
    color: #cbd5e1;
}

[data-theme="dark"] .ms-contributor-social-link {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .ms-contributor-box__footer {
    border-color: #334155;
}

[data-theme="dark"] .ms-contributor-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .ms-legal-disclaimer-box {
    background: #1e293b;
    border-color: #334155;
    border-left-color: #3b82f6;
}

[data-theme="dark"] .ms-legal-disclaimer__title {
    color: #f1f5f9;
}

[data-theme="dark"] .ms-legal-disclaimer__text {
    color: #94a3b8;
}

/* ==========================================================================
   6. Responsive Layout
   ========================================================================== */
@media (max-width: 640px) {
    .ms-contributor-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .ms-contributor-box__header {
        flex-direction: column;
        align-items: center;
    }

    .ms-contributor-box__socials {
        margin-top: 6px;
    }

    .ms-cta-banner {
        padding: 22px 18px;
    }

    .ms-cta-banner__actions {
        flex-direction: column;
    }

    .ms-cta-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   7. Header Contributor Profile Button & Dropdown Menu
   ========================================================================== */
.ms-header-profile-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.ms-header-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff !important;
    background-color: var(--fp-accent-primary, #e63946);
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(var(--fp-accent-primary-rgb, 230, 57, 70), 0.25);
    transition: all 0.2s ease;
}

[data-scheme="presisi-gold"] .ms-header-auth-btn,
.theme-presisi-gold .ms-header-auth-btn {
    background-color: #E5B82A;
    color: #0A0A0A !important;
    box-shadow: 0 2px 8px rgba(229, 184, 42, 0.3);
}

.ms-header-auth-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.ms-header-auth-btn--circle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    color: var(--fp-text-secondary, #64748b) !important;
    background-color: var(--fp-bg-secondary, #f1f5f9) !important;
    border: 1px solid var(--fp-border-color, #e2e8f0) !important;
    box-shadow: none !important;
    font-size: 16px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

.ms-header-auth-btn--circle:hover {
    color: var(--fp-accent-primary, #e63946) !important;
    border-color: var(--fp-accent-primary, #e63946) !important;
    background-color: var(--fp-bg-primary, #ffffff) !important;
    transform: translateY(-1px) scale(1.05) !important;
}

/* Presisi Gold Profile Button */
[data-scheme="presisi-gold"] .ms-header-auth-btn--circle,
.theme-presisi-gold .ms-header-auth-btn--circle {
    color: #E5B82A !important;
    background-color: rgba(229, 184, 42, 0.12) !important;
    border: 1px solid rgba(229, 184, 42, 0.45) !important;
    box-shadow: 0 0 10px rgba(229, 184, 42, 0.15) !important;
}

[data-scheme="presisi-gold"] .ms-header-auth-btn--circle:hover,
.theme-presisi-gold .ms-header-auth-btn--circle:hover {
    color: #0A0A0A !important;
    background-color: #E5B82A !important;
    border-color: #E5B82A !important;
    box-shadow: 0 0 14px rgba(229, 184, 42, 0.5) !important;
}

/* General Dark Mode Profile Button */
[data-theme="dark"] .ms-header-auth-btn--circle {
    color: #F8FAFC !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .ms-header-auth-btn--circle:hover {
    color: var(--fp-accent-primary, #e63946) !important;
    border-color: var(--fp-accent-primary, #e63946) !important;
    background-color: rgba(255, 255, 255, 0.16) !important;
}

.ms-header-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 3px 12px 3px 4px;
    border-radius: 20px;
    background-color: var(--fp-bg-secondary, #f1f5f9);
    border: 1px solid var(--fp-border-color, #e2e8f0);
    color: var(--fp-text-primary, #1e293b);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

body.scheme-presisi-gold .ms-header-profile-btn,
body.theme-presisi-gold .ms-header-profile-btn,
[data-theme="dark"] .ms-header-profile-btn,
[data-scheme="presisi-gold"] .ms-header-profile-btn,
.theme-presisi-gold .ms-header-profile-btn {
    background-color: #141412 !important;
    border: 1px solid rgba(229, 184, 42, 0.35) !important;
    color: #ffffff !important;
}

.ms-header-profile-btn:hover,
.ms-header-profile-btn[aria-expanded="true"] {
    border-color: var(--fp-accent-primary, #e63946);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

body.scheme-presisi-gold .ms-header-profile-btn:hover,
body.scheme-presisi-gold .ms-header-profile-btn[aria-expanded="true"],
body.theme-presisi-gold .ms-header-profile-btn:hover,
body.theme-presisi-gold .ms-header-profile-btn[aria-expanded="true"],
[data-scheme="presisi-gold"] .ms-header-profile-btn:hover,
[data-scheme="presisi-gold"] .ms-header-profile-btn[aria-expanded="true"] {
    border-color: #E5B82A !important;
    box-shadow: 0 0 14px rgba(229, 184, 42, 0.35) !important;
}

.ms-header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--fp-bg-tertiary, #20201d);
    border: 1.5px solid var(--fp-accent-primary, #e63946);
    flex-shrink: 0;
}

body.scheme-presisi-gold .ms-header-avatar,
body.theme-presisi-gold .ms-header-avatar,
[data-scheme="presisi-gold"] .ms-header-avatar,
.theme-presisi-gold .ms-header-avatar {
    border-color: #E5B82A !important;
    background-color: #181816 !important;
}

.ms-header-user-name {
    font-size: 13px;
    font-weight: 700;
    max-width: 95px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--fp-text-primary, inherit);
}

.ms-header-chevron {
    font-size: 10px;
    color: var(--fp-accent-primary, currentColor);
    opacity: 0.85;
    transition: transform 0.2s ease;
}

.ms-header-profile-btn[aria-expanded="true"] .ms-header-chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu Container */
.ms-header-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: var(--fp-bg-elevated, var(--fp-bg-secondary, #ffffff));
    border: 1px solid var(--fp-border-color, #e2e8f0);
    border-radius: 12px;
    padding: 14px;
    box-shadow: var(--fp-shadow-md, 0 12px 32px rgba(0, 0, 0, 0.2));
    z-index: 1000;
    animation: msDropdownFade 0.2s ease-out;
}

body.scheme-presisi-gold .ms-header-dropdown,
body.theme-presisi-gold .ms-header-dropdown,
[data-theme="dark"] .ms-header-dropdown,
[data-scheme="presisi-gold"] .ms-header-dropdown,
.theme-presisi-gold .ms-header-dropdown {
    background: #141412 !important;
    border: 1px solid rgba(229, 184, 42, 0.35) !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8) !important;
    color: #ffffff !important;
}

@keyframes msDropdownFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ms-header-dropdown-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
}

.ms-dropdown-avatar-large {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--fp-bg-tertiary, #20201d);
    border: 2px solid var(--fp-accent-primary, #e63946);
    flex-shrink: 0;
}

body.scheme-presisi-gold .ms-dropdown-avatar-large,
body.theme-presisi-gold .ms-dropdown-avatar-large,
[data-scheme="presisi-gold"] .ms-dropdown-avatar-large,
.theme-presisi-gold .ms-dropdown-avatar-large {
    border-color: #E5B82A !important;
    background-color: #181816 !important;
}

.ms-dropdown-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ms-dropdown-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--fp-text-primary, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

body.scheme-presisi-gold .ms-dropdown-name,
body.theme-presisi-gold .ms-dropdown-name,
[data-theme="dark"] .ms-dropdown-name,
[data-scheme="presisi-gold"] .ms-dropdown-name,
.theme-presisi-gold .ms-dropdown-name {
    color: #ffffff !important;
}

.ms-dropdown-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #166534;
}

body.scheme-presisi-gold .ms-dropdown-badge,
body.theme-presisi-gold .ms-dropdown-badge,
[data-theme="dark"] .ms-dropdown-badge,
[data-scheme="presisi-gold"] .ms-dropdown-badge,
.theme-presisi-gold .ms-dropdown-badge {
    color: #E5B82A !important;
}

.ms-dropdown-divider {
    height: 1px;
    background: var(--fp-border-color, #e2e8f0);
    margin: 8px 0;
}

body.scheme-presisi-gold .ms-dropdown-divider,
body.theme-presisi-gold .ms-dropdown-divider,
[data-theme="dark"] .ms-dropdown-divider,
[data-scheme="presisi-gold"] .ms-dropdown-divider,
.theme-presisi-gold .ms-dropdown-divider {
    background: rgba(229, 184, 42, 0.2) !important;
}

.ms-dropdown-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ms-dropdown-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fp-text-secondary, #475569);
    text-decoration: none !important;
    transition: all 0.15s ease;
}

body.scheme-presisi-gold .ms-dropdown-links li a,
body.theme-presisi-gold .ms-dropdown-links li a,
[data-theme="dark"] .ms-dropdown-links li a,
[data-scheme="presisi-gold"] .ms-dropdown-links li a,
.theme-presisi-gold .ms-dropdown-links li a {
    color: #E2E8F0 !important;
}

.ms-dropdown-links li a:hover {
    background: var(--fp-bg-secondary, #f1f5f9);
    color: var(--fp-accent-primary, #e63946);
}

body.scheme-presisi-gold .ms-dropdown-links li a:hover,
body.theme-presisi-gold .ms-dropdown-links li a:hover,
[data-theme="dark"] .ms-dropdown-links li a:hover,
[data-scheme="presisi-gold"] .ms-dropdown-links li a:hover,
.theme-presisi-gold .ms-dropdown-links li a:hover {
    background: #20201c !important;
    color: #E5B82A !important;
}

.ms-dropdown-links li a i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--fp-accent-primary, #e63946);
    opacity: 0.9;
}

body.scheme-presisi-gold .ms-dropdown-links li a i,
body.theme-presisi-gold .ms-dropdown-links li a i,
[data-scheme="presisi-gold"] .ms-dropdown-links li a i,
.theme-presisi-gold .ms-dropdown-links li a i {
    color: #E5B82A !important;
}

.ms-dropdown-footer {
    padding-top: 4px;
}

.ms-dropdown-logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #dc2626 !important;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.ms-dropdown-logout-link:hover {
    background: rgba(220, 38, 38, 0.08);
}

@media (max-width: 768px) {
    .ms-header-user-name,
    .ms-header-chevron {
        display: none !important;
    }

    .ms-header-profile-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    .ms-header-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        margin: 0;
    }

    .ms-header-auth-text {
        display: none;
    }

    .ms-header-auth-btn {
        width: 38px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .ms-header-dropdown {
        width: 250px;
        right: 0;
    }
}

