/* ==================== IMPORTS ==================== */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Inter:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;600;700&family=Noto+Sans+JP:wght@400;500;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Background */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --bg-quaternary: #2a2a2a;
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-tertiary: #a0a0a0;
    --text-quaternary: #707070;
    
    /* Border & Divider */
    --border-main: #2a2a2a;
    --border-light: #1a1a1a;
    --divider: #0f0f0f;
    
    /* Accent (Cyan - Electric Blue) */
    --accent-primary: #00d4ff;
    --accent-secondary: #00a8cc;
    --accent-bright: #00ffff;
    
    /* Utility */
    --shadow-sm: 0 0 16px rgba(0, 212, 255, 0.1);
    --shadow-md: 0 0 32px rgba(0, 212, 255, 0.15);
    --shadow-lg: 0 0 64px rgba(0, 212, 255, 0.2);
    --glow-sm: 0 0 8px rgba(0, 212, 255, 0.3);
    --glow-md: 0 0 16px rgba(0, 212, 255, 0.5);
}

/* ==================== PRETENDARD: 한국어/일본어 ==================== */
:lang(ko), :lang(ko) * {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    word-break: keep-all;
}
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3, :lang(ko) h4, :lang(ko) h5, :lang(ko) h6 {
    font-family: 'Pretendard', sans-serif;
    letter-spacing: -0.03em;
}
:lang(ja), :lang(ja) * {
    font-family: 'Noto Sans JP', 'Pretendard', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(ja) h4, :lang(ja) h5, :lang(ja) h6 {
    font-family: 'Noto Sans JP', 'Pretendard', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    letter-spacing: -0.01em;
}
:lang(zh), :lang(zh) * {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
}
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(zh) h4, :lang(zh) h5, :lang(zh) h6 {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
    letter-spacing: -0.01em;
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Mono', 'IBM Plex Mono', monospace;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    text-transform: uppercase;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.2rem;
}

p {
    font-weight: 400;
    font-size: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 3px solid var(--accent-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(10, 10, 10, 0.95);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.1);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    transition: all 0.25s ease;
    text-transform: uppercase;
}

.navbar-logo:hover {
    color: var(--accent-primary);
    text-shadow: 0 0 16px rgba(0, 212, 255, 0.6);
    transform: skewX(-2deg);
}

.logo-image {
    height: 32px;
    width: auto;
    object-fit: contain;
    transition: all 0.25s ease;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0));
}

.navbar-logo:hover .logo-image {
    filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.8));
}

.logo-text {
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    flex: 1;
    margin-left: 3rem;
}

.nav-menu a {
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    transition: all 0.25s ease;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.25s ease;
}

.nav-menu a:hover {
    color: var(--accent-primary);
}

.nav-menu a:hover::before {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.language-selector {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-main);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.language-selector:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-sm);
}

.language-selector:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--glow-md);
}

.ui-icon {
    display: inline-block;
    color: var(--accent-primary);
    font-size: 0.95em;
    line-height: 1;
    vertical-align: -0.12em;
    margin-right: 0.35em;
}

.ui-icon-sm {
    font-size: 0.9em;
    vertical-align: -0.08em;
    margin-right: 0.25em;
}

.ui-icon-lg {
    font-size: 2.2rem;
    line-height: 1;
    margin-right: 0;
    vertical-align: middle;
}

.ui-icon-muted {
    color: var(--text-tertiary);
}

.user-badge {
    padding: 0.5rem 1.25rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-main);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.user-badge:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: var(--glow-sm);
}

.btn-login,
.btn-post,
.btn-logout {
    padding: 0.65rem 1.5rem;
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.btn-login::before,
.btn-post::before,
.btn-logout::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    z-index: -1;
    transition: left 0.25s ease;
}

.btn-login:hover,
.btn-post:hover,
.btn-logout:hover {
    color: var(--bg-primary);
    box-shadow: var(--glow-md);
}

.btn-login:hover::before,
.btn-post:hover::before,
.btn-logout:hover::before {
    left: 0;
}

/* ==================== MAIN CONTENT ==================== */
main {
    min-height: calc(100vh - 200px);
    position: relative;
}

/* ==================== HERO SECTION ==================== */
.hero {
    padding: 5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content h1 {
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-tertiary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: stretch;
    max-width: 1000px;
    width: 100%;
}

.hero-search-input {
    width: 100%;
    min-width: 0;
    padding: 0.95rem 1rem;
    background: rgba(10, 10, 10, 0.9);
    border: 2px solid var(--border-main);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.25s ease;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.hero-search-input::placeholder {
    color: var(--text-quaternary);
}

.hero-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--glow-md);
    background: rgba(26, 26, 26, 0.95);
}

.hero-search-btn {
    padding-inline: 1.6rem;
    min-width: 110px;
    white-space: nowrap;
}

.btn-primary {
    padding: 0.8rem 2.5rem;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    font-family: 'Space Mono', monospace;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    z-index: -1;
    transition: right 0.25s ease;
}

.btn-primary:hover {
    transform: skewX(-2deg);
    box-shadow: var(--glow-md);
}

.btn-primary:hover::before {
    right: 0;
}

.btn-secondary {
    padding: 0.8rem 2.5rem;
    background: transparent;
    border: 3px solid var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1rem;
    position: relative;
    font-family: 'Space Mono', monospace;
}

.btn-secondary:hover {
    transform: skewX(-2deg);
    box-shadow: var(--glow-md);
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.8);
}

.hero-graphic {
    perspective: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 380px;
}

.geometric-shape {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    animation: float 6s ease-in-out infinite;
    box-shadow: var(--glow-lg);
    opacity: 0.9;
}

.hero-floating-stack {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-floating-card {
    position: absolute;
    width: min(270px, 78%);
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(0, 212, 255, 0.28);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.02) inset;
    color: var(--text-primary);
    text-decoration: none;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    transform-origin: center;
    overflow: hidden;
    min-height: 154px;
}

.hero-floating-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-floating-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(2px) brightness(0.38) saturate(0.9);
    transform: scale(1.05);
}

.hero-floating-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 14% 14%, rgba(0, 212, 255, 0.18), transparent 52%),
        linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.72));
    z-index: 1;
}

.hero-floating-content {
    position: relative;
    z-index: 2;
    padding: 0.9rem 1rem;
}

.hero-floating-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(0,212,255,0.08) 45%, transparent 100%);
    transform: translateX(-120%);
    transition: transform 0.45s ease;
    z-index: 3;
    pointer-events: none;
}

.hero-floating-card:hover {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55), 0 0 18px rgba(0, 212, 255, 0.18);
}

.hero-floating-card:hover::after {
    transform: translateX(120%);
}

.hero-floating-card-1 {
    top: 20px;
    left: 18%;
    z-index: 4;
    animation: floatCardA 8s ease-in-out infinite;
}

.hero-floating-card-2 {
    top: 138px;
    right: 10%;
    z-index: 3;
    animation: floatCardB 9.2s ease-in-out infinite;
}

.hero-floating-card-3 {
    bottom: 20px;
    left: 8%;
    z-index: 2;
    animation: floatCardC 10.4s ease-in-out infinite;
}

.hero-floating-rank {
    font-family: 'Space Mono', monospace;
    color: var(--accent-primary);
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.hero-floating-meta {
    color: var(--text-quaternary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

.hero-floating-title {
    font-weight: 700;
    line-height: 1.25;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
    word-break: break-word;
}

.hero-floating-stats {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.7rem;
    color: var(--text-tertiary);
    font-size: 0.78rem;
}

.hero-floating-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

@keyframes floatCardA {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-4deg); }
    50% { transform: translate3d(10px, -16px, 0) rotate(-2deg); }
}

@keyframes floatCardB {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(6deg); }
    50% { transform: translate3d(-14px, -18px, 0) rotate(3deg); }
}

@keyframes floatCardC {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-7deg); }
    50% { transform: translate3d(14px, -14px, 0) rotate(-3deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
}

@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 3rem 2rem;
    }

    .hero-search-form {
        grid-template-columns: 1fr;
    }

    .geometric-shape {
        width: 200px;
        height: 200px;
    }

    .hero-graphic {
        min-height: 320px;
        width: 100%;
    }

    .hero-floating-card {
        width: min(230px, 84%);
        padding: 0.8rem 0.9rem;
    }

    .hero-floating-card-1 {
        top: 6px;
        left: 6%;
    }

    .hero-floating-card-2 {
        top: 108px;
        right: 4%;
    }

    .hero-floating-card-3 {
        bottom: 8px;
        left: 16%;
    }
}

/* ==================== SECTION TITLES ==================== */
.section-title {
    text-align: center;
    margin: 4rem 0 3rem;
    position: relative;
    padding-bottom: 2rem;
}

.section-title h2 {
    margin-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--accent-primary) 50%, transparent 100%);
}

.section-subtitle {
    color: var(--text-tertiary);
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* ==================== CARDS GRID ==================== */
.cards-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

/* ==================== WEBSITE CARD ==================== */
.website-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-main);
    padding: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.website-card:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    box-shadow: var(--glow-md);
}

.website-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.website-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-md);
    transform: translateY(-4px) skewY(-1deg);
}

.website-card:hover::before {
    opacity: 1;
}

.card-image {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-quaternary) 100%);
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.website-card:hover .card-image img {
    transform: scale(1.05) rotate(1deg);
}

.card-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-category {
    display: inline-block;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.25rem 0.65rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.55rem;
    width: fit-content;
}

.card-title {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    text-transform: uppercase;
    font-family: 'Space Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.card-url {
    color: var(--accent-primary);
    font-size: 0.78rem;
    margin-bottom: 0.55rem;
    word-break: break-all;
    font-family: 'IBM Plex Mono', monospace;
}

.card-description {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card-stats {
    display: flex;
    gap: 0.5rem;
    margin: 0.55rem 0;
    padding: 0.4rem 0;
    border-top: 1px solid var(--border-main);
    border-bottom: 1px solid var(--border-main);
    font-size: 0.8rem;
}

.stat {
    flex: 1;
    text-align: center;
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--accent-primary);
    display: block;
}

.stat-label {
    color: var(--text-quaternary);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-action-btn {
    flex: 1;
    padding: 0.45rem 0.7rem;
    background: transparent;
    border: 1px solid var(--border-main);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.card-action-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: var(--glow-sm);
}

.card-heart {
    padding: 0.45rem 0.5rem;
    min-width: 46px;
    text-align: center;
}

.card-heart .bi {
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
}

.card-heart.liked {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.45);
}

.card-visit-btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    font-weight: 700;
}

.card-visit-btn:hover {
    color: var(--bg-primary);
    box-shadow: var(--glow-md);
    transform: scale(1.02);
}

/* ==================== FORMS ==================== */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-main);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--glow-md);
    background: var(--bg-quaternary);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-buttons button {
    flex: 1;
}

/* ==================== SEARCH & FILTER ==================== */
.search-section {
    max-width: 1400px;
    margin: 3rem auto 2rem;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: end;
}

.search-input {
    width: 100%;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-main);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.25s ease;
}

.search-input::placeholder {
    color: var(--text-quaternary);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--glow-md);
}

.filter-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-main);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.9rem;
}

.filter-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.filter-btn:hover {
    border-color: var(--accent-primary);
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--bg-secondary);
    border-top: 3px solid var(--accent-primary);
    padding: 2rem;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glitch {
    0%, 100% {
        clip-path: inset(0 0 0 0);
    }
    20% {
        clip-path: inset(10% 0 65% 0);
    }
    40% {
        clip-path: inset(42% 0 1% 0);
    }
    60% {
        clip-path: inset(25% 0 58% 0);
    }
    80% {
        clip-path: inset(54% 0 7% 0);
    }
}

.card-title {
    animation: slideInUp 0.6s ease forwards;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        margin-left: 0;
        gap: 1.5rem;
    }
    
    .nav-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .search-section {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        width: 100%;
        justify-content: center;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .cards-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

/* ==================== UTILITIES ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.text-center {
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.gap-2 {
    gap: 1rem;
}

/* ==================== COMMENTS SECTION ==================== */
.comments-section {
    background: var(--bg-secondary);
    border: 2px solid var(--border-main);
    padding: 2rem;
    margin-top: 2rem;
}

.comment-form {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-main);
}

.comment-input {
    width: 100%;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
    transition: all 0.25s ease;
}

.comment-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--glow-sm);
}

.comment-button {
    margin-top: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Space Mono', monospace;
}

.comment-button:hover {
    transform: skewX(-2deg);
    box-shadow: var(--glow-md);
}

.comment-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-primary);
}

.comment-author {
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.comment-time {
    color: var(--text-quaternary);
    font-size: 0.8rem;
    margin-left: 1rem;
}

.comment-text {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.comment-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 1rem;
}

.comment-action-btn {
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid var(--border-main);
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.comment-action-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.nested-comments {
    margin-left: 2rem;
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-main);
}

.reply-form {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-quaternary);
    border-left: 3px solid var(--accent-primary);
}

.reply-input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 60px;
    transition: all 0.25s ease;
}

.reply-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--glow-sm);
}

.reply-button {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    font-family: 'Space Mono', monospace;
}

.reply-button:hover {
    transform: skewX(-2deg);
    box-shadow: var(--glow-md);
}

/* ==================== TABS ==================== */
.tabs-header {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-main);
}

.tab-button {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.tab-button:hover {
    color: var(--accent-primary);
}

.tab-button.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    box-shadow: 0 8px 16px rgba(0, 212, 255, 0.1);
}

.tab-content {
    display: none;
    animation: slideInUp 0.4s ease forwards;
}

.tab-content.active {
    display: block;
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 1rem;
    border-left: 3px solid;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-error {
    background: rgba(255, 52, 52, 0.1);
    border-left-color: #ff3434;
    color: #ff9999;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-left-color: #4caf50;
    color: #81c784;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #ffeb3b;
}

/* ==================== NOTIFICATION BELL ==================== */
.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    text-decoration: none;
}

.notification-bell:hover {
    color: var(--accent-primary);
}

.bell-icon {
    font-size: 1rem;
    line-height: 1;
}

.notification-badge {
    position: absolute;
    top: 0.15rem;
    right: 0.15rem;
    min-width: 18px;
    height: 18px;
    background: var(--accent-primary);
    color: #000;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* ==================== NOTIFICATION ITEMS ==================== */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-main);
    transition: border-color 0.2s ease;
}

.notification-item:hover {
    border-color: var(--accent-primary);
}

.notification-unread {
    border-left: 3px solid var(--accent-primary);
    background: rgba(var(--accent-primary-rgb, 0,240,255), 0.03);
}

.notification-icon {
    min-width: 1.8rem;
    height: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-main);
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.notification-icon .bi {
    font-size: 0.95rem;
    line-height: 1;
}

.notification-body {
    flex: 1;
    line-height: 1.6;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.notification-actor {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 0.3rem;
}

.notification-time {
    font-size: 0.8rem;
    color: var(--text-quaternary);
    margin-top: 0.25rem;
}

.notification-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.5rem;
    box-shadow: 0 0 6px var(--accent-primary);
}

/* ==================== STAT CARDS (Admin/Analytics) ==================== */
.stat-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-main);
    padding: 1.5rem;
    transition: border-color 0.2s ease;
}

.stat-card:hover {
    border-color: var(--accent-primary);
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.stat-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-main);
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.stat-card-icon .bi {
    font-size: 1rem;
    line-height: 1;
}

.stat-card-warn {
    border-color: #f59e0b;
}

.stat-card-warn .stat-card-value {
    color: #f59e0b;
}

/* ==================== SEARCH AUTOCOMPLETE ==================== */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-top: none;
    z-index: 500;
    max-height: 360px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: background 0.15s ease;
    border: none;
    background: transparent;
}

.suggestion-item:hover,
.suggestion-item.suggestion-active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.suggestion-icon {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-style: normal;
}

.suggestion-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== ADMIN BUTTON ==================== */
.btn-admin {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #f59e0b;
    color: #f59e0b;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-admin:hover {
    background: #f59e0b;
    color: #000;
}

/* ==================== USER BADGE AVATAR ==================== */
.user-badge-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.35rem;
    vertical-align: middle;
    border: 1px solid var(--border-main);
}

/* ==================== FOOTER LINKS ==================== */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-quaternary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* ==================== CJK 폰트 강제 오버라이드 ==================== */
/* Space Mono 등 고정 폰트 지정 요소에 대해 높은 명시도로 Pretendard 덮어씌움 */
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3,
:lang(ko) h4, :lang(ko) h5, :lang(ko) h6,
:lang(ko) .btn-primary,
:lang(ko) .btn-secondary,
:lang(ko) .btn-login,
:lang(ko) .btn-post,
:lang(ko) .btn-logout,
:lang(ko) .card-action-btn,
:lang(ko) .tab-button,
:lang(ko) .user-badge,
:lang(ko) .nav-menu a,
:lang(ko) .language-selector,
:lang(ko) .card-url,
:lang(ko) .card-category,
:lang(ko) .stat-label,
:lang(ko) .comment-author,
:lang(ko) .comment-time,
:lang(ko) .comment-button,
:lang(ko) .reply-button,
:lang(ko) .filter-btn,
:lang(ko) .card-title,
:lang(ko) button,
:lang(ko) input,
:lang(ko) textarea,
:lang(ko) select {
    font-family: 'Pretendard', sans-serif;
}

:lang(ja) h1, :lang(ja) h2, :lang(ja) h3,
:lang(ja) h4, :lang(ja) h5, :lang(ja) h6,
:lang(ja) .btn-primary,
:lang(ja) .btn-secondary,
:lang(ja) .btn-login,
:lang(ja) .btn-post,
:lang(ja) .btn-logout,
:lang(ja) .card-action-btn,
:lang(ja) .tab-button,
:lang(ja) .user-badge,
:lang(ja) .nav-menu a,
:lang(ja) .language-selector,
:lang(ja) .card-url,
:lang(ja) .card-category,
:lang(ja) .stat-label,
:lang(ja) .comment-author,
:lang(ja) .comment-time,
:lang(ja) .comment-button,
:lang(ja) .reply-button,
:lang(ja) .filter-btn,
:lang(ja) .card-title,
:lang(ja) button,
:lang(ja) input,
:lang(ja) textarea,
:lang(ja) select {
    font-family: 'Pretendard', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

/* 템플릿 인라인 monospace 스타일 보정 */
:lang(ko) [style*="IBM Plex Mono"],
:lang(ko) [style*="Space Mono"] {
    font-family: 'Pretendard', sans-serif !important;
}

:lang(ja) [style*="IBM Plex Mono"],
:lang(ja) [style*="Space Mono"] {
    font-family: 'Pretendard', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif !important;
}

/* ==================== MOBILE LAYOUT FIXES (KEEP DESKTOP UI) ==================== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .cards-container {
        padding: 0 0.25rem;
        gap: 0.75rem;
    }

    img,
    canvas {
        max-width: 100%;
    }

    .nav-actions {
        gap: 0.6rem;
        justify-content: center;
    }

    .nav-actions > * {
        max-width: 100%;
    }

    .user-badge {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .language-selector {
        min-width: 0;
    }

    .search-filters-form {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .search-filters-form .search-input,
    .search-filters-form select,
    .search-filters-form button {
        width: 100% !important;
        min-width: 0 !important;
    }

    .profile-header-panel {
        padding: 1.25rem 1rem !important;
    }

    .profile-header-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .profile-header-grid > div:first-child {
        justify-self: center;
    }

    .profile-header-actions {
        width: 100%;
    }

    .profile-header-actions > * {
        width: 100%;
    }

    .profile-bio-text {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .follow-list-item {
        grid-template-columns: auto 1fr !important;
        padding: 0.85rem 0.9rem !important;
        gap: 0.75rem !important;
    }

    .follow-list-item-cta {
        display: none;
    }

    .analytics-chart-panel {
        padding: 1rem !important;
    }

    .analytics-chart-controls {
        gap: 0.5rem !important;
    }

    .analytics-chart-controls label:last-child {
        margin-left: 0 !important;
        width: 100%;
        justify-content: space-between;
    }

    .analytics-table-wrap {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .analytics-table-wrap table {
        min-width: 520px;
    }

    .admin-page-header {
        align-items: stretch !important;
    }

    .admin-search-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .admin-search-form .search-input {
        width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 100%;
    }

    .admin-search-form .btn-primary {
        width: 100%;
    }

    .admin-table-wrap {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table-wrap table {
        min-width: 720px;
    }

    .website-detail-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        margin-bottom: 2rem !important;
    }

    .website-detail-stats-grid {
        grid-template-columns: 1fr !important;
        padding: 1rem !important;
        gap: 0.75rem !important;
    }

    .website-detail-actions > * {
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }

    .website-detail-sidebar {
        padding: 1rem !important;
    }

    .card-image {
        height: 100px;
    }

    .card-content {
        padding: 0.65rem;
    }

    .card-category {
        margin-bottom: 0.4rem;
        font-size: 0.6rem;
        padding: 0.18rem 0.45rem;
    }

    .card-title {
        font-size: 0.86rem;
        margin-bottom: 0.2rem;
        line-height: 1.25;
    }

    .card-url {
        display: none;
    }

    .card-description {
        display: none;
    }

    .card-stats {
        margin: 0.35rem 0;
        padding: 0.35rem 0;
        gap: 0.25rem;
        font-size: 0.68rem;
    }

    .stat-value {
        font-size: 0.72rem;
    }

    .stat-label {
        font-size: 0.55rem;
        letter-spacing: 0;
    }

    .card-actions {
        gap: 0.35rem;
    }

    .card-action-btn {
        padding: 0.35rem 0.45rem;
        font-size: 0.64rem;
        letter-spacing: 0.01em;
    }

    .card-heart {
        min-width: 38px;
        padding: 0.35rem 0.3rem;
    }

    .comments-section {
        padding: 1rem;
    }

    .nested-comments {
        margin-left: 0.75rem;
        padding-left: 0.6rem;
    }

    .tabs-header {
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .tab-button {
        white-space: nowrap;
        min-width: max-content;
    }
}

@media (max-width: 420px) {
    .cards-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        padding: 0;
    }

    .card-image {
        height: 88px;
    }

    .card-content {
        padding: 0.55rem;
    }
}
