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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 30px;
    color: #333;
}

/* Global Header Styles */
.global-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    font-size: 1.2em;
}

.logo-icon {
    font-size: 1.5em;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-item {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: #f0f4ff;
    color: #667eea;
}

.nav-btn {
    border: none;
    background: #f0f4ff;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
}

/* Language Selector in Header */
.language-selector {
    position: relative;
}

.language-button {
    background: transparent;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    color: #555;
    transition: all 0.2s;
}

.language-button:hover {
    border-color: #667eea;
    color: #667eea;
}

.language-dropdown {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    overflow: hidden;
    z-index: 1001;
    border: 1px solid #eee;
}

.language-dropdown.active {
    display: block;
}

.language-option {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95em;
}

.language-option:hover {
    background: #f8f9fa;
}

.language-option.selected {
    background: #f0f4ff;
    color: #667eea;
    font-weight: 600;
}

/* Dark Mode Overrides for Header */
body.dark-mode .global-header {
    background: #2a2a2a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .logo-area {
    color: #e0e0e0;
}

body.dark-mode .nav-item {
    color: #aaa;
}

body.dark-mode .nav-item:hover,
body.dark-mode .nav-item.active {
    background: #3a3a3a;
    color: #a0a0ff;
}

body.dark-mode .nav-btn {
    background: #3a3a3a;
    color: #a0a0ff;
}

body.dark-mode .nav-btn:hover {
    background: #a0a0ff;
    color: white;
}

body.dark-mode .language-button {
    border-color: #444;
    color: #aaa;
}

body.dark-mode .language-button:hover {
    border-color: #a0a0ff;
    color: #a0a0ff;
}

body.dark-mode .language-dropdown {
    background: #333;
    border-color: #444;
}

body.dark-mode .language-option {
    color: #e0e0e0;
}

body.dark-mode .language-option:hover {
    background: #3a3a3a;
}

body.dark-mode .language-option.selected {
    background: #3a3a3a;
    color: #a0a0ff;
}

/* 태블릿 */
@media (max-width: 991px) {
    body {
        padding: 20px;
    }
}

/* 모바일 */
@media (max-width: 575px) {
    body {
        padding: 10px;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 태블릿 */
@media (max-width: 1199px) {
    .container {
        max-width: 95%;
    }
}

/* 모바일 */
@media (max-width: 767px) {
    .container {
        max-width: 100%;
        border-radius: 10px;
    }
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 40px 40px;
}

header h1 {
    font-size: 3em;
    margin: 0;
}

.subtitle {
    font-size: 1.3em;
    opacity: 0.9;
}

main {
    padding: 30px 40px;
}

/* 태블릿 */
@media (max-width: 991px) {
    header {
        padding: 35px 30px;
    }

    header h1 {
        font-size: 2.5em;
    }

    main {
        padding: 40px 30px;
    }
}

/* 모바일 */
@media (max-width: 767px) {
    header {
        padding: 25px 20px;
    }

    header h1 {
        font-size: 2em;
    }

    main {
        padding: 30px 20px;
    }
}

.intro {
    text-align: center;
    margin-bottom: 40px;
}

.description {
    font-size: 1.1em;
    line-height: 1.8;
    color: #555;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

/* 데스크톱 중간 사이즈 */
@media (max-width: 1399px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 태블릿 */
@media (max-width: 991px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* 모바일 */
@media (max-width: 575px) {
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.tool-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px 20px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.tool-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
}

.tool-card h3 {
    font-size: 1.1em;
    color: #667eea;
    margin-bottom: 8px;
    font-weight: 600;
}

.tool-card p {
    font-size: 0.85em;
    color: #666;
    line-height: 1.4;
}

/* 데스크톱 큰 화면 */
@media (min-width: 1400px) {
    .tool-card {
        min-height: 200px;
        padding: 30px 25px;
    }

    .tool-icon {
        font-size: 3em;
    }

    .tool-card h3 {
        font-size: 1.2em;
    }

    .tool-card p {
        font-size: 0.9em;
    }
}

/* 태블릿 */
@media (max-width: 991px) {
    .tool-card {
        min-height: 160px;
        padding: 20px 15px;
    }

    .tool-icon {
        font-size: 2.3em;
    }

    .tool-card h3 {
        font-size: 1em;
    }

    .tool-card p {
        font-size: 0.8em;
    }
}

/* 모바일 */
@media (max-width: 575px) {
    .tool-card {
        min-height: 140px;
        padding: 20px;
    }

    .tool-icon {
        font-size: 2.5em;
    }

    .tool-card h3 {
        font-size: 1.1em;
    }

    .tool-card p {
        font-size: 0.85em;
    }
}

/* Results Section */
#results-container {
    min-height: 100px;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #667eea;
}

.results {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.result-header h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.risk-score {
    font-size: 3em;
    font-weight: bold;
    margin: 20px 0;
}

.risk-label {
    font-size: 1.2em;
    opacity: 0.9;
}

.summary {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.pivot-paths h3 {
    font-size: 1.8em;
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.path-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    border-left: 5px solid #667eea;
    transition: transform 0.2s, box-shadow 0.2s;
}

.path-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.path-card h4 {
    font-size: 1.3em;
    color: #667eea;
    margin-bottom: 10px;
}

.path-card p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.skills {
    margin-top: 15px;
}

.skills strong {
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

footer {
    background: #f8f9fa;
    text-align: center;
    padding: 20px;
    color: #666;
}

.footer-disclaimer {
    text-align: center;
    padding: 20px;
    font-size: 0.8em;
    color: #999;
    line-height: 1.6;
    background: #f0f2f5;
    border-top: 1px solid #e1e4e8;
    margin-top: 0;
}

/* Utility Page Styles */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
}

.back-link:hover {
    background: #5568d3;
}

.util-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.util-section h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #667eea;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    border-color: #667eea;
    outline: none;
}

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

.btn-primary {
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    color: #667eea;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.result-display {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #667eea;
    margin-top: 20px;
    min-height: 50px;
}

.calculator-display {
    background: #2d3748;
    color: white;
    padding: 20px;
    font-size: 2em;
    text-align: right;
    border-radius: 10px;
    margin-bottom: 20px;
    min-height: 60px;
    word-break: break-all;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calc-btn {
    padding: 20px;
    font-size: 1.3em;
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.calc-btn:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

.calc-btn.operator {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.calc-btn.operator:hover {
    background: #5568d3;
}

.calc-btn.equal {
    background: #48bb78;
    color: white;
    border-color: #48bb78;
    grid-column: span 2;
}

.calc-btn.equal:hover {
    background: #38a169;
}

.calc-btn.clear {
    background: #f56565;
    color: white;
    border-color: #f56565;
}

.calc-btn.clear:hover {
    background: #e53e3e;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2em;
    }

    .description {
        font-size: 1em;
    }

    main {
        padding: 20px 15px;
    }

    .util-section {
        padding: 20px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .calculator-buttons {
        gap: 8px;
    }

    .calc-btn {
        padding: 15px;
        font-size: 1.1em;
    }
}

/* 다크모드 스타일 */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

body.dark-mode .container {
    background: #2a2a2a;
}

body.dark-mode header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode header h1,
body.dark-mode .subtitle {
    color: #a0a0ff;
}

body.dark-mode .description {
    color: #bbb;
}

body.dark-mode .tool-card {
    background: #333;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .tool-card h3 {
    color: #a0a0ff;
}

body.dark-mode .tool-card p {
    color: #aaa;
}

body.dark-mode .tool-card:hover {
    border-color: #7c7cff;
    background: #3a3a3a;
    box-shadow: 0 10px 25px rgba(124, 124, 255, 0.3);
}

body.dark-mode .util-section {
    background: #333;
}

body.dark-mode .util-section h2 {
    color: #a0a0ff;
}

body.dark-mode .input-group label {
    color: #e0e0e0;
}

body.dark-mode .input-group input,
body.dark-mode .input-group textarea,
body.dark-mode .input-group select {
    background: #1a1a1a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .input-group input:focus,
body.dark-mode .input-group textarea:focus,
body.dark-mode .input-group select:focus {
    border-color: #7c7cff;
}

body.dark-mode .btn-primary {
    background: linear-gradient(135deg, #5a5aff 0%, #7c7cff 100%);
}

body.dark-mode .btn-primary:hover {
    box-shadow: 0 5px 15px rgba(124, 124, 255, 0.4);
}

body.dark-mode .btn-secondary {
    color: #a0a0ff;
    background: #2a2a2a;
    border-color: #7c7cff;
}

body.dark-mode .btn-secondary:hover {
    background: #7c7cff;
    color: white;
}

body.dark-mode .result-display {
    background: #1a1a1a;
    border-color: #7c7cff;
    color: #e0e0e0;
}

body.dark-mode .calculator-display {
    background: #1a1a1a;
    color: #a0a0ff;
    border: 2px solid #444;
}

body.dark-mode .calc-btn {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .calc-btn:hover {
    background: #4a4a4a;
}

body.dark-mode .calc-btn.operator {
    background: #5a5aff;
}

body.dark-mode .calc-btn.operator:hover {
    background: #7c7cff;
}

body.dark-mode .calc-btn.equal {
    background: #38a169;
}

body.dark-mode .calc-btn.equal:hover {
    background: #48bb78;
}

body.dark-mode .calc-btn.clear {
    background: #e53e3e;
}

body.dark-mode .calc-btn.clear:hover {
    background: #f56565;
}

body.dark-mode footer {
    background: #333;
    color: #888;
}

body.dark-mode .footer-disclaimer {
    background: #252525;
    color: #777;
    border-top-color: #444;
}

body.dark-mode .back-link {
    background: #5a5aff;
}

body.dark-mode .back-link:hover {
    background: #7c7cff;
}

body.dark-mode .result-header {
    background: linear-gradient(135deg, #7c7cff 0%, #5a5aff 100%);
}

body.dark-mode .summary {
    background: #3a3a2a;
    border-left-color: #d4af37;
    color: #e0e0e0;
}

body.dark-mode .path-card {
    background: #333;
    border-left-color: #7c7cff;
}

body.dark-mode .path-card h4 {
    color: #a0a0ff;
}

body.dark-mode .path-card p {
    color: #bbb;
}

body.dark-mode .skill-tag {
    background: #5a5aff;
}

body.dark-mode .loading {
    color: #a0a0ff;
}

/* ===================================
   Floating Share Button Styles
   =================================== */

.floating-share-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.floating-share-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.floating-share-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.floating-share-container.active .floating-share-button {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: rotate(180deg);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.share-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.floating-share-container.active .share-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

.share-option:hover {
    background: #f7fafc;
}

.share-option.kakao {
    color: #3c1e1e;
}

.share-option.kakao:hover {
    background: #fee500;
    color: #3c1e1e;
}

.share-option.facebook {
    color: #1877f2;
}

.share-option.facebook:hover {
    background: #e7f3ff;
}

.share-option.twitter {
    color: #1da1f2;
}

.share-option.twitter:hover {
    background: #e8f5fd;
}

.share-option.link {
    color: #718096;
}

.share-option.link:hover {
    background: #edf2f7;
}

.share-option svg {
    flex-shrink: 0;
}

/* Toast notification */
.share-toast {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: #2d3748;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

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

/* Mobile responsive */
@media (max-width: 768px) {
    .floating-share-container {
        bottom: 20px;
        right: 20px;
    }

    .floating-share-button {
        width: 48px;
        height: 48px;
    }

    .share-menu {
        bottom: 60px;
        min-width: 160px;
    }

    .share-option {
        padding: 10px 12px;
        font-size: 13px;
    }

    .share-toast {
        bottom: 80px;
        right: 20px;
        font-size: 13px;
    }
}

/* Dark mode support */
body.dark-mode .share-menu {
    background: #2d3748;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

body.dark-mode .share-option {
    color: #e2e8f0;
}

body.dark-mode .share-option:hover {
    background: #4a5568;
}

body.dark-mode .share-option.kakao {
    color: #fee500;
}

body.dark-mode .share-option.facebook {
    color: #3b82f6;
}

body.dark-mode .share-option.twitter {
    color: #38bdf8;
}

body.dark-mode .share-option.link {
    color: #cbd5e0;
}

body.dark-mode .share-toast {
    background: #1a202c;
}