:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.14);

    --positive: #16a34a;
    --negative: #ef4444;
    --warning: #f59e0b;

    --background: #f4f6fb;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text-main: #0f172a;
    --text-sub: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-color: var(--border);

    --input-bg: #f9fafb;
    --radius: 0.9rem;
    --radius-lg: 1.25rem;
    --header-height: 64px;
    --header-bg: rgba(255, 255, 255, 0.9);
    --header-border: rgba(15, 23, 42, 0.08);

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 24px 50px rgba(15, 23, 42, 0.14);
}

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
    background-color: var(--background);
    background-image: radial-gradient(900px 520px at 10% -15%, rgba(219, 234, 254, 0.65), transparent 60%),
    radial-gradient(820px 460px at 90% -20%, rgba(220, 252, 231, 0.55), transparent 55%);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    letter-spacing: -0.01em;
    overflow-x: hidden;
    width: 100%;
}

ol, ul {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

* { box-sizing: border-box; }

.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem;
    flex: 1;
    width: 100%;
}

@media (max-width: 768px) {
    .app-container {
        padding: 1.5rem 1rem;
    }
}

.btn {
    padding: 0.6rem 1.1rem;
    border-radius: 0.9rem;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.28);
}

.btn-secondary {
    background-color: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: var(--border-strong);
}

.card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.6rem;
    border: 1px solid var(--border);
}

input {
    font-family: inherit;
}

.styled-input {
    width: 100%;
    border-radius: 0.9rem;
    border: 1px solid var(--border);
    background-color: var(--surface);
    padding: 0.65rem 0.9rem;
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.2s;
}

.styled-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.styled-input::placeholder {
    color: #b0b8c1;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
}


.text-positive {
    color: var(--positive) !important;
}

.text-negative {
    color: var(--negative) !important;
}

footer {
    background-color: transparent;
    padding: 3rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-sub);
    font-size: 0.8rem;
}

.footer-container {
    padding: 0;
}

.footer-inline-link {
    color: inherit;
    text-decoration: underline;
}

.feedback-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.feedback-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.feedback-modal-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.feedback-modal-description {
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.feedback-modal-warning {
    margin-bottom: 1rem;
    color: #f04452;
    font-size: 0.85rem;
    font-weight: 600;
}

.feedback-modal-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 1rem;
}

.feedback-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.feedback-modal-btn {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.feedback-modal-btn-secondary {
    border: 1px solid #ddd;
    background: #fff;
}

.feedback-modal-btn-primary {
    border: none;
    background: #3182f6;
    color: #fff;
    font-weight: 600;
}

/* Header Styles */
.site-header {
    height: var(--header-height);
    background-color: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    transition: all 0.3s ease;
}

.header-content {
    max-width: 1280px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-main);
    transition: opacity 0.2s;
    height: 100%;
}

.brand:hover {
    opacity: 0.8;
}

.brand-icon {
    display: flex;
    align-items: center;
}

.brand-icon img {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 6px;
}


.desktop-nav {
    display: flex;
    gap: 2rem;
    margin-left: 3rem;
    align-items: center;
    height: 100%;
}

.nav-link {
    text-decoration: none;
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-link:hover {
    color: var(--text-main);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.2s ease-in-out;
    border-radius: 2px;
}

.nav-link:hover::after {
    width: 100%;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-profile {
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.greeting {
    color: var(--text-sub);
    font-weight: 500;
}

.profile-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    transition: color 0.2s;
}

.profile-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.btn-auth {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-login {
    background-color: var(--text-main);
    color: white;
}

.btn-login:hover {
    background-color: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-logout {
    background-color: #f2f4f6;
    color: var(--text-sub);
}

.btn-logout:hover {
    background-color: #e5e8eb;
    color: var(--text-main);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2.5px;
    background-color: var(--text-main);
    border-radius: 4px;
    transition: all 0.3s;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu-wrapper {
    position: absolute;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10000;
}

.mobile-menu-overlay.active .mobile-menu-wrapper {
    right: 0;
}

.mobile-menu-content {
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.close-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-sub);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-menu-btn:hover {
    color: var(--text-main);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.mobile-nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f2f4f6;
    transition: color 0.2s;
}

.mobile-nav-link:hover {
    color: var(--primary);
}

.mobile-user-info {
    background-color: #f9fafb;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.user-profile-mobile {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.btn-mobile-profile {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-sub);
    text-decoration: none;
    border: 1px solid #e5e8eb;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: white;
}

.mobile-auth-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-mobile-auth {
    width: 100%;
    padding: 0.9rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
}

.btn-mobile-auth.btn-login {
    background-color: var(--text-main);
    color: white;
}

.btn-mobile-auth.btn-logout {
    background-color: #f2f4f6;
    color: var(--text-main);
}

/* Tooltip */
.tooltip-container {
    position: relative;
    display: flex;
    align-items: center;
}

.tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #666;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
}

.tooltip-inline {
    margin-left: 8px;
}

.help-tooltip {
    visibility: hidden;
    width: 300px;
    background-color: #fff;
    color: #333;
    text-align: left;
    border-radius: 8px;
    padding: 15px;
    position: absolute;
    z-index: 10;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #eee;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: normal;
}

.help-tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
}

.tooltip-container:hover .tooltip-text,
.tooltip-container:hover .help-tooltip {
    visibility: visible;
    opacity: 1;
}

.help-tooltip ol {
    padding-left: 20px;
    margin: 8px 0 0 0;
}

.help-tooltip li {
    margin-bottom: 4px;
}

/* Shared modal styles for portfolio pages */
.portfolio-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: portfolioModalFadeIn 0.2s ease-out;
}

.portfolio-modal .modal-content {
    background-color: var(--surface);
    padding: 2.5rem;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: portfolioModalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

.portfolio-modal h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-size: 1.5rem;
}

.portfolio-modal .modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 2rem;
}

.portfolio-modal .modal-actions .btn {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
}

@keyframes portfolioModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@media (max-width: 768px) {
    .desktop-nav, .desktop-user-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-content {
        padding: 0 1.25rem;
    }
}
