/* ETFolio 스타일 - 다크 테마 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    background: #0f172a;
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.2rem;
    color: #94a3b8;
}

.card {
    background: #1e293b;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
}

.card h2 {
    color: #f1f5f9;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

.form-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group input,
.form-group select {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 1px solid #475569;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #0f172a;
    color: #e2e8f0;
}

.form-group select[size] {
    min-height: 150px;
    overflow-y: auto;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: #64748b;
}

.form-group input[readonly] {
    background: #1e293b;
    color: #94a3b8;
}

button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

button:active {
    transform: translateY(0);
}

.korean-etf-suggestions {
    margin-top: 10px;
    padding: 15px;
    background: #0f172a;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.korean-etf-suggestions p {
    color: #94a3b8;
    margin: 5px 0;
    font-size: 0.95rem;
}

#portfolio-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-item {
    padding: 20px;
    background: #0f172a;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #334155;
}

.summary-item h3 {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 8px;
    font-weight: 500;
}

.summary-item p {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
}

.summary-item.positive p {
    color: #10b981;
}

.summary-item.negative p {
    color: #ef4444;
}

#etf-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.etf-item {
    padding: 15px;
    background: #0f172a;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #334155;
}

.etf-item h3 {
    color: #f1f5f9;
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.etf-item p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 4px 0;
}

.etf-item button {
    background: #ef4444;
    margin-top: 10px;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.etf-item button:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

#analytics-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.analytics-metric {
    padding: 15px;
    background: #0f172a;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #334155;
}

.analytics-metric h4 {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 5px;
    font-weight: 500;
}

.analytics-metric p {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f1f5f9;
}

#price-chart, #dividend-chart, #return-chart, #allocation-chart {
    margin-top: 20px;
}

footer {
    text-align: center;
    color: #64748b;
    opacity: 0.8;
    margin-top: 40px;
    padding: 20px;
    font-size: 0.9rem;
}

/* Plotly 차트 스타일 오버라이드 */
.plotly {
    background: #0f172a !important;
}

/* DB Info Button (Floating) */
.db-info-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transition: all 0.3s;
    z-index: 1000;
}

.db-info-btn:hover {
    transform: scale(1.1);
    background: #2563eb;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.3s ease-out;
}

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

.modal-content {
    background: #1e293b;
    padding: 0;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid #334155;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 25px 30px;
    background: #0f172a;
    color: #f1f5f9;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: #334155;
    border: none;
    color: #e2e8f0;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #475569;
    transform: rotate(90deg);
}

#dbInfoContent {
    padding: 30px;
}

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

.db-status h3 {
    color: #f1f5f9;
    margin: 15px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.db-status p {
    color: #94a3b8;
    margin: 10px 0;
    line-height: 1.6;
}

.db-type {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 10px 0;
}

.db-type.postgres {
    background: #3b82f6;
    color: white;
}

.db-type.sqlite {
    background: #10b981;
    color: white;
}

.connection-url {
    background: #0f172a;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #334155;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #e2e8f0;
    word-break: break-all;
    margin-top: 10px;
}

/* Choices.js 다크 테마 커스텀 */
.choices__inner {
    background-color: #0f172a !important;
    border: 1px solid #475569 !important;
    color: #e2e8f0 !important;
}

.choices__input {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

.choices__list--dropdown {
    background-color: #1e293b !important;
    border: 1px solid #475569 !important;
}

.choices__item {
    color: #e2e8f0 !important;
}

.choices__item--selectable.is-highlighted {
    background-color: #3b82f6 !important;
}

.choices__placeholder {
    color: #64748b !important;
}

/* 추천 탭 스타일 */
.recommendation-tabs {
    display: flex;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
    border-bottom: 2px solid #334155;
    padding-bottom: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 10px 16px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
    position: relative;
}

.tab-btn:hover {
    background: #0f172a;
    color: #f1f5f9;
}

.tab-btn.active {
    background: #3b82f6;
    color: white;
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3b82f6;
}
