/* ==========================================================================
   CSS Stylesheet for Digital Business Card Pop-up
   Theme: Sage & Slate Glassmorphism Card + Modal Popup Windows
   ========================================================================== */

:root {
    --bg-main: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --text-sub: #94a3b8;

    --teal-primary: #0d9488;
    --teal-hover: #0f766e;
    --teal-light: #e6fffa;

    --badge-pink-bg: #ffe4e6; --badge-pink-text: #e11d48;
    --badge-purple-bg: #f3e8ff; --badge-purple-text: #7c3aed;
    --badge-amber-bg: #fef3c7; --badge-amber-text: #d97706;
    --badge-blue-bg: #e0f2fe; --badge-blue-text: #0284c7;

    --border-color: rgba(226, 232, 240, 0.9);
    --shadow-card: 0 20px 40px -15px rgba(13, 148, 136, 0.18), 0 0 15px rgba(0,0,0,0.05);

    --radius-card: 24px;
    --radius-modal: 20px;
    --radius-btn: 12px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #0b1329;
    --bg-card: rgba(30, 41, 59, 0.85);
    --text-primary: #f8faf9;
    --text-muted: #94a3b8;
    --text-sub: #64748b;

    --teal-primary: #14b8a6;
    --teal-hover: #2dd4bf;
    --teal-light: rgba(20, 184, 166, 0.15);

    --border-color: rgba(51, 65, 85, 0.9);
    --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Noto Sans KR', 'Outfit', sans-serif;
    background-color: var(--bg-main);
    background-image: radial-gradient(at 0% 0%, rgba(153, 246, 228, 0.3) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(221, 214, 254, 0.3) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    padding: 1rem;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Globs Background */
.background-glob {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    z-index: -1;
    opacity: 0.45;
}

.glob-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #99f6e4, #0d9488);
    top: -100px;
    right: -100px;
}

.glob-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #ddd6fe, #a78bfa);
    bottom: -100px;
    left: -100px;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

/* Header Top Controls */
.top-controls {
    position: fixed;
    top: 1rem;
    width: calc(100% - 2rem);
    max-width: 480px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.control-brand {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--teal-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-card);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.control-btns {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--teal-light);
    color: var(--teal-primary);
}

.btn-sub {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition);
}

.btn-sub:hover {
    border-color: var(--teal-primary);
    color: var(--teal-primary);
}

/* 3D Card Viewport */
.card-viewport {
    perspective: 1200px;
    width: 100%;
    max-width: 440px;
    margin-top: 3.5rem;
}

.card-flipper {
    width: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.card-flipper.flipped {
    transform: rotateY(180deg);
}

.card-face {
    width: 100%;
    border-radius: var(--radius-card);
    padding: 1.8rem;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.card-back {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.school-badge {
    background: var(--teal-light);
    color: var(--teal-primary);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 12px;
}

.btn-flip-trigger {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition);
}

.btn-flip-trigger:hover {
    color: var(--teal-primary);
    border-color: var(--teal-primary);
}

/* Profile Hero */
.profile-hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    margin-bottom: 0.75rem;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-card);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border: 2px solid var(--bg-card);
}

.card-name {
    font-size: 1.7rem;
    font-weight: 700;
}

.eng-name {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-muted);
}

.card-role {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--teal-primary);
    margin-top: 0.15rem;
}

.card-tagline {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.4rem;
}

/* Badge Row */
.badge-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-pink { background: var(--badge-pink-bg); color: var(--badge-pink-text); }
.badge-purple { background: var(--badge-purple-bg); color: var(--badge-purple-text); }
.badge-amber { background: var(--badge-amber-bg); color: var(--badge-amber-text); }
.badge-blue { background: var(--badge-blue-bg); color: var(--badge-blue-text); }

/* Contact List */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0,0,0,0.02);
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: var(--transition);
}

[data-theme="dark"] .contact-row {
    background: rgba(255,255,255,0.03);
}

.contact-row:hover {
    border-color: var(--teal-primary);
    transform: translateX(3px);
}

.contact-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--teal-light);
    color: var(--teal-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.contact-info {
    display: flex;
    flex-direction: column;
}

.c-label { font-size: 0.7rem; color: var(--text-muted); }
.c-val { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.copy-hint { font-size: 0.75rem; color: var(--teal-primary); margin-left: 0.3rem; }

/* Card Action Buttons */
.card-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.btn-action {
    flex: 1;
    padding: 0.7rem;
    border-radius: var(--radius-btn);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: var(--transition);
    border: none;
}

.btn-action.primary {
    background: var(--teal-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.btn-action.primary:hover {
    background: var(--teal-hover);
    transform: translateY(-2px);
}

.btn-action.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-action.secondary:hover {
    border-color: var(--teal-primary);
    color: var(--teal-primary);
    background: var(--teal-light);
}

/* Card Back Content */
.back-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.85rem;
}

.summary-section h3 {
    font-size: 0.9rem;
    color: var(--teal-primary);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.summary-list {
    list-style: none;
    padding-left: 0.5rem;
}

.summary-list li {
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    position: relative;
    padding-left: 0.85rem;
}

.summary-list li::before {
    content: "•";
    color: var(--teal-primary);
    position: absolute;
    left: 0;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tag-cloud span {
    background: var(--teal-light);
    color: var(--teal-primary);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* ==========================================================================
   POPUP MODAL WINDOWS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    border-radius: var(--radius-modal);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open .modal-card {
    transform: translateY(0) scale(1);
}

.modal-lg {
    max-width: 650px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.sub-header {
    font-size: 0.78rem;
    color: var(--teal-primary);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1rem 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--teal-primary);
    border-bottom-color: var(--teal-primary);
}

.tab-content {
    display: none;
}

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

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.item-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0,0,0,0.02);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: var(--radius-btn);
}

[data-theme="dark"] .item-box {
    background: rgba(255,255,255,0.03);
}

.item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.icon-pink { background: var(--badge-pink-bg); color: var(--badge-pink-text); }
.icon-purple { background: var(--badge-purple-bg); color: var(--badge-purple-text); }
.icon-blue { background: var(--badge-blue-bg); color: var(--badge-blue-text); }

.item-title { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.item-sub { font-size: 0.75rem; color: var(--text-muted); }

.mini-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tl-block {
    padding-left: 1rem;
    border-left: 2px solid var(--teal-primary);
}

.tl-date { font-size: 0.75rem; font-weight: 700; color: var(--teal-primary); }
.tl-block h4 { font-size: 0.95rem; color: var(--text-primary); margin: 0.15rem 0; }
.tl-block p { font-size: 0.85rem; color: var(--text-muted); }

.edu-box {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.edu-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--teal-light);
    color: var(--teal-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.edu-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Story Grid inside Cover Modal */
.cover-quote {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--teal-primary);
    background: var(--teal-light);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-btn);
    border-left: 3px solid var(--teal-primary);
}

.story-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.story-card {
    background: rgba(0,0,0,0.02);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-btn);
}

[data-theme="dark"] .story-card {
    background: rgba(255,255,255,0.03);
}

.story-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.story-head .num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--teal-primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-head h4 {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.story-card p {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    background: var(--teal-primary);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.6rem 1.1rem;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transform: translateY(80px);
    opacity: 0;
    transition: var(--transition);
    z-index: 3000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Print CSS */
@media print {
    .top-controls, .background-glob, .toast, .btn-flip-trigger, .btn-action {
        display: none !important;
    }
    body { background: #ffffff !important; color: #000000 !important; }
    .card-flipper { transform: none !important; }
    .card-face { border: 1px solid #ccc !important; box-shadow: none !important; background: none !important; }
    .card-back { position: relative !important; transform: none !important; margin-top: 1rem; }
}
