@charset "UTF-8";

/**
 * MANTA V3 - Unified Style System
 * Fonts: Gmarket Sans (Brand), Noto Sans KR (System)
 */

/* --- 1. Web Fonts --- */
@font-face {
    font-family: 'GMarketSans';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansLight.woff') format('woff');
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'GMarketSans';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff') format('woff');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'GMarketSans';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff') format('woff');
    font-weight: 700;
    font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* --- 2. Design Tokens --- */
:root {
    /* Brand Colors */
    --brand: #2575FC;
    --brand-purple: #6F3FF5;
    --brand-hover: #1A60D6;
    --brand-soft: #F0F6FF;

    /* Neutral Colors */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-900: #111827;

    /* Semantic Colors */
    --text: var(--gray-900);
    --sub-text: var(--gray-500);
    --line: var(--gray-100);
    --bg: var(--gray-50);

    /* Typography */
    --font-brand: 'GMarketSans', sans-serif;
    --font-system: 'Noto Sans KR', 'Roboto', sans-serif;

    /* Spacing & Sizes */
    --header-height: 60px;
    --nav-height: 64px;
    --safe-bottom: 0px;
    --nav-total-height: var(--nav-height);
    --app-max-width: 480px;
    --gutter: 20px;
    --radius: 12px;
    --radius-full: 999px;

    /* Filters */
    --brand-filter: invert(36%) sepia(85%) rotate(211deg) brightness(101%) contrast(105%);
}

/* --- 3. Base Style --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-system);
    background-color: var(--white);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;

    padding-top: var(--header-height);
    padding-bottom: 0;

}

img {
    display: block;
    max-width: 100%;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Font Utilities */
.font-brand {
    font-family: var(--font-brand) !important;
}

.font-system {
    font-family: var(--font-system) !important;
}

/* Apply Brand Font to Nicknames, Titles, and Headings */
h1,
h2,
h3,
h4,
h5,
h6,
.header-title,
.section-header,
.nickname,
.nickname-text,
.partner-nickname,
.author-nickname,
.index-header-left strong,
.post-title,
.title,
.index-description,
.notice-title,
.faq-question span,
.match-title,
.category-item span {
    font-family: var(--font-brand) !important;
    letter-spacing: -0.02em;
}

/* --- 4. Common Components --- */

/* Header */
.common-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    z-index: 2000;
}

.header-left,
.header-right {
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-left {
    justify-content: flex-start;
}

/* 왼쪽 정렬 허용 */
.header-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-brand);
    font-weight: 500;
    font-size: 17px;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

.icon-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:active {
    background: var(--gray-100);
}

.icon-btn img {
    width: 22px;
}

/* Navigation */
.common-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);

    width: 100%;
    max-width: var(--app-max-width);

    height: var(--nav-total-height);
    padding-bottom: 0;

    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    display: flex;
    justify-content: space-around;
    align-items: flex-start;

    border-top: 1px solid var(--line);
    z-index: 2000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 2px;
    flex: 1;
    height: 100%;

    color: var(--gray-400);
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.nav-item img {
    width: 28px;
    opacity: 0.6;
    transition: 0.2s;
}

.nav-item span {
    font-weight: 500;
}

.nav-item.active {
    color: var(--brand);
}

/* brightness(0)으로 검게 만든 후, 정밀한 필터 수식으로 브랜드 블루(#2575FC) 생성 */
.nav-item.active img {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(39%) sepia(70%) rotate(205deg) brightness(101%) contrast(106%);
}

.nav-item.active span {
    font-weight: 700;
}

/* Loading */
.loading-modal {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-modal.active {
    display: flex;
}

.loading-logo {
    width: 70px;
    animation: manta-pulse 1.5s infinite ease-in-out;
}

@keyframes manta-pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* Modal System */
.manta-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10001;
    /* 로딩보다 높게 */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Toast System */
.manta-toast-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: auto;
    pointer-events: none;
}

.manta-toast {
    background: rgba(30, 41, 59, 0.9);
    color: #fff;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    animation: toast-in-up 0.3s ease forwards, toast-out 0.3s ease 2.7s forwards;
    white-space: nowrap;
    text-align: center;
}

@keyframes toast-in-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-10px);
        opacity: 0;
    }
}

.manta-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.manta-modal-card {
    background: #fff;
    width: 100%;
    max-width: 320px;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.manta-modal-overlay.active .manta-modal-card {
    transform: translateY(0);
}

.manta-modal-title {
    font-family: var(--font-brand);
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
    text-align: center;
}

.manta-modal-message {
    font-size: 15px;
    color: var(--gray-500);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 24px;
    word-break: keep-all;
}

.manta-modal-actions {
    display: flex;
    gap: 10px;
}

.manta-modal-btn {
    flex: 1;
    height: 48px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-brand);
    transition: 0.2s;
}

.manta-modal-btn.cancel {
    background: var(--gray-100);
    color: var(--gray-500);
}

.manta-modal-btn.confirm {
    background: var(--brand);
    color: #fff;
}

.manta-modal-btn.danger {
    background: #ff4d4d;
    color: #fff;
}

.manta-modal-btn:active {
    transform: scale(0.96);
}

/* Profile Popup System */
.profile-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 12000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-popup-overlay.active {
    display: flex;
    opacity: 1;
}

.profile-popup-card {
    background: #fff;
    width: 100%;
    max-width: 360px;
    border-radius: 28px;
    padding: 35px 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.profile-popup-overlay.active .profile-popup-card {
    transform: translateY(0);
}

.popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    opacity: 0.4;
}

.popup-profile-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.popup-avatar {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--brand-soft);
    margin-bottom: 12px;
}

.popup-nick {
    font-family: var(--font-brand);
    font-size: 20px;
    font-weight: 500;
    color: var(--gray-900);
}

.popup-level-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.popup-level-item {
    background: var(--gray-50);
    padding: 12px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.popup-level-item .label {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 700;
}

.popup-level-item .val {
    font-size: 13px;
    color: var(--brand);
    font-weight: 600;
}

.popup-posts-title {
    font-family: var(--font-brand);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid var(--brand);
}

.popup-post-item {
    padding: 15px;
    border-radius: 16px;
    border: 1px solid var(--gray-100);
    margin-bottom: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.popup-post-item:active {
    background: var(--gray-50);
}

.popup-post-item .t {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 6px;
    display: block;
    font-family: var(--font-brand);
}

.popup-post-item .m {
    font-size: 12px;
    color: var(--gray-400);
}

.app-container {
    width: 100%;
    max-width: var(--app-max-width);
    margin: 0 auto;

    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));

    /*
     * 고정 하단 네비게이션 높이 +
     * 콘텐츠가 메뉴에 너무 붙지 않도록 여유 공간 20px
     */
    padding-bottom: calc(var(--nav-height) + 8px);

    background-color: var(--white);
    position: relative;
    display: flex;
    flex-direction: column;
}

.section-header {
    padding: 20px 16px 10px;
    font-family: var(--font-brand);
    font-size: 18px;
    font-weight: 700;
}