/* 기본 스타일 리셋 및 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #f8f9fa;
    --text-color: #2c3e50;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --nav-height: 70px;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    padding-top: var(--nav-height);
}

/* Navigation Styles */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--nav-height);
}

.nav-logo h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--secondary-color);
}

/* Section Styles */
.section {
    display: none;
    min-height: auto;
    padding: 1.25rem 0;
}

.section.active {
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* CV Section */
.cv-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

.cv-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.cv-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.cv-item h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.cv-item p {
    color: #666;
    line-height: 1.6;
}

.cv-download {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* News Section */
.news-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

.news-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.news-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: var(--transition);
}

.news-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.news-date {
    font-weight: 500;
    color: var(--secondary-color);
    margin-right: 1rem;
    min-width: 100px;
}

.news-text {
    color: var(--text-color);
}

/* Bio Section */
.bio-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

.bio-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.bio-content p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.bio-content p:last-child {
    margin-bottom: 0;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-color);
    color: white;
}

/* Profile Card */
.profile-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
}

/* Make profile image larger and ensure parent doesn't constrain it */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Bigger, circular profile container (desktop) */
.profile-img {
    width: 300px !important;
    height: 300px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    margin: 0 auto 1rem;
    display: block;
}

/* Ensure inner img fills container */
.profile-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    max-width: none !important;
}

/* Responsive sizes */
@media (max-width: 1024px) {
    .profile-img { width: 280px !important; height: 280px !important; }
}
@media (max-width: 600px) {
    .profile-img { width: 140px !important; height: 140px !important; }
}

.profile-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.profile-card p {
    color: #666;
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.skills h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.project-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.project-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: #f8f9fa;
    color: var(--text-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    border: 1px solid #e0e0e0;
}

.project-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.project-link:hover {
    text-decoration: underline;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 2rem;
}

.contact-info h3,
.contact-form h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.contact-item {
    display: flex;
    margin-bottom: 1rem;
}

.contact-label {
    font-weight: 500;
    width: 100px;
    color: var(--text-color);
}

.contact-value {
    color: #666;
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
}

footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* For Jun Section Styles */
#for-jun {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin: 2rem 0;
}

#for-jun .container {
    padding: 2rem;
}

#for-jun h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.section-description {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* For Fun Quiz */
.section-inset { margin-top: 2rem; }
.quiz-card {
  background: #fff;
  padding: 1.25rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 1rem;
}
.quiz-card h3 { margin-bottom: .5rem; color: var(--primary-color); }
.quiz-row { display: flex; gap: .5rem; margin: .75rem 0; }
.quiz-row input[type="number"] {
  padding: .6rem .8rem; border: 1px solid #ddd; border-radius: var(--border-radius); flex: 1;
}
.solution.hidden { display: none; }
.quiz-feedback { margin-top: .5rem; font-weight: 600; }
.quiz-feedback.ok { color: #2ecc71; }
.quiz-feedback.no { color: var(--accent-color); }

.fun-tab {
  color: #000 !important;
}


/* 기존 퀀트 시스템 스타일 유지 */
.step {
    display: none;
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.step.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

/* 대시보드 스타일 */
.dashboard {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.market-overview, .quick-stats {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}

/* 전략 카드 스타일 */
.strategy-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.strategy-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: var(--transition);
}

.strategy-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.strategy-card.selected {
    border-color: var(--secondary-color);
    background-color: #f7f9fc;
}

.strategy-chart {
    height: 200px;
    margin: 1rem 0;
}

.strategy-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.strategy-btn:hover {
    background: #2980b9;
}

/* 백테스트 스타일 */
.backtest-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.backtest-controls select,
.backtest-controls input,
.backtest-controls button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.performance-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.metric {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
}

.metric h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.metric p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}

/* 포트폴리오 스타일 */
.portfolio-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

#holdings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#holdings-table th,
#holdings-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#holdings-table th {
    background: #f8f9fa;
    font-weight: 500;
}

/* 시장동향 스타일 */
.market-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
}

#news-headlines {
    flex: 1;
    min-width: 300px;
    max-width: 350px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

#tradingview-widget {
    flex: 3;
    min-width: 400px;
    height: 450px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.market-news {
    background: #fff;
    padding: 1.0rem;
    border-radius: 8px;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .cv-content {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .dashboard,
    .market-container {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .section {
        padding: 1.5rem 0;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 0.5rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
    }
    
    .hero {
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .cv-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .news-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.8rem;
    }
    
    .news-date {
        min-width: auto;
        margin-right: 0;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .skill-tags {
        justify-content: center;
    }
    
    .backtest-controls {
        flex-direction: column;
    }
    
    #news-headlines,
    #tradingview-widget {
        flex: none;
        width: 100%;
        max-width: none;
        min-width: auto;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .section {
        padding: 1rem 0;
    }
    
    .cv-section,
    .news-section,
    .bio-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .cv-section h2,
    .news-section h2,
    .bio-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
}

#news-headlines h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
}

#news-headlines ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#news-headlines li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: #444;
    font-size: 0.95em;
}

#news-headlines li:last-child {
    border-bottom: none;
}

#news-headlines .news-source {
    margin-top: 15px;
    font-size: 0.8em;
    color: #666;
}

#news-headlines .news-source a {
    color: #007bff;
    text-decoration: none;
}

#news-headlines .news-source a:hover {
    text-decoration: underline;
}

#market-indicators {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.indicator-item {
    text-align: center;
    margin: 5px 10px;
}

.indicator-label {
    display: block;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

.indicator-value {
    display: block;
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
}

.indicator-change {
    display: block;
    font-size: 0.9em;
}

.indicator-change.positive {
    color: #28a745;
}

.indicator-change.negative {
    color: #dc3545;
}

/* home 섹션 내 컨테이너 스타일 */
#home .container {
    margin-bottom: 2rem;
}

#home .container h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

#home .container p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

#home .container ul {
    list-style: none;
    margin: 1rem 0;
    padding-left: 1.5rem;
}

#home .container ul li {
    margin-bottom: 0.5rem;
    position: relative;
}

#home .container ul li:before {
    content: "•";
    color: #3498db;
    position: absolute;
    left: -1.5rem;
}

.step {
    display: none;
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.step.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.stock-list {
    margin: 2rem 0;
    display: grid;
    gap: 1rem;
}

.stock-item {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #e0e0e0;
    transition: var(--transition);
}

.stock-item:hover {
    transform: translateX(5px);
    border-color: var(--secondary-color);
}

.stock-item label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.stock-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.strategy-card {
    cursor: pointer;
    padding: 20px;
    margin: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.selected-stocks {
    margin: 20px 0;
    padding: 15px;
    background-color: #f7f9fc;
    border-radius: 5px;
}

#selected-stocks-list {
    margin-top: 10px;
}

#selected-stocks-list div {
    padding: 5px 0;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 2rem;
    background-color: var(--accent-color);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.price {
    margin-left: 10px;
    font-weight: bold;
}

.change {
    margin-left: 10px;
}

.change.up {
    color: #e74c3c;
}

.change.down {
    color: #3498db;
}

/* 기존 CSS에 추가 */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

.back-button {
    background-color: #95a5a6;
}

button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--secondary-color);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

/* 파라미터 설정 스타일 */
.parameter-controls {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.parameter-group {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.slider-group {
    margin: 1rem 0;
}

input[type="range"] {
    width: 100%;
    margin: 1rem 0;
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
