/* portfolio.css - 포트폴리오 전용 스타일 */

/* 기본 body 스타일 */
body {
    font-family: 'Malgun Gothic', '맑은 고딕', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    line-height: 1.6;
    font-size: 16px; /* 기본 폰트 크기 16px */
}

/* 컨테이너 스타일 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 0;
    padding: 30px;
    box-shadow: none;
    min-height: calc(100vh - 80px);
}

/* 기존 환영 섹션 스타일 */
.welcome-section {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.welcome-section h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 20px;
}

.welcome-section p {
    font-size: 1.2em;
    margin-bottom: 30px;
    line-height: 1.8;
}

.welcome-section .features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
    text-align: left;
}

.feature-card {
    background: #f8f9fa;
    padding: 30px 25px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.feature-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.feature-card p {
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
}

/* 기존 주식 현황 스타일 */
.stock-status-container {
    margin: 20px 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.stock-header {
    background: linear-gradient(135deg, #2F5597 0%, #4472C4 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
}

.stock-info-box {
    margin: 20px;
    padding: 20px;
    background-color: #FAFBFF;
    border: 1px solid #E0E7FF;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.purchase-info {
    font-size: 16px;
    font-weight: 600;
    color: #2F5597;
    margin-bottom: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 6px;
    border-left: 4px solid #4472C4;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 15px;
    color: #333;
}

/* 상세 정보 컨테이너 - 반응형 개선 */
.stock-detail-container {
    margin-top: 40px;
    background: white;
    min-height: 400px;
    border-radius: 10px;
    border: 1px solid #ddd;
    overflow: visible;  /* hidden에서 visible로 변경 */
    width: 100%;        /* 추가 */
    max-width: 100%;    /* 추가 */
    box-sizing: border-box;  /* 추가 */
}

/* iframe 스타일 추가 - 반응형 처리 */
.stock-detail-container iframe {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    min-height: 600px;
    border: none;
    display: block;
}

.loading-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* 포트폴리오 컨테이너 - 개선된 가독성 */
.portfolio-container {
    background: linear-gradient(135deg, #e8eeff 0%, #f0f4ff 100%); /* 옅은 보라-파랑 */
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    color: #1a202c; /* 진한 회색 */
    border: 1px solid #d6e3ff;
}

.portfolio-header {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.portfolio-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 0;
    color: #2d3748; /* 더 진한 색 */
    white-space: nowrap;
}

.user-info-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.user-info-text {
    font-size: 16px; /* 15px → 16px */
    white-space: nowrap;
    background: rgba(255,255,255,0.7); /* 더 진한 배경 */
    color: #2d3748; /* 진한 글자색 */
    padding: 5px 10px;
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.portfolio-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-card {
    background: rgba(255,255,255,0.8); /* 더 진한 배경 */
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: #2d3748; /* 진한 글자색 */
}

.summary-label {
    font-size: 16px;
    opacity: 0.8;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568; /* 중간 회색 */
}

.summary-value {
    font-size: 20px;
    font-weight: bold;
    color: #2d3748; /* 진한 글자색 */
}

/* 요약 섹션의 수익 색상 */
.summary-value.profit-positive {
    color: #c53030 !important; /* 빨간색 (기존: #1e3a8a 파란색) */
}

.summary-value.profit-negative {
    color: #1e3a8a !important; /* 파란색 (기존: #c53030 빨간색) */
}

.profit-positive {
    color: #c53030; /* 빨간색 (기존: #1e3a8a 파란색) */
}

.profit-negative {
    color: #1e3a8a; /* 파란색 (기존: #c53030 빨간색) */
}

.stock-search-section {
    margin: 20px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.searchable-dropdown {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.stock-search-input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.4);
    background-color: rgba(255,255,255,0.8); /* 더 진한 배경 */
    color: #2d3748; /* 진한 글자색 */
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.stock-search-input::placeholder {
    color: rgba(45, 55, 72, 0.6); /* 진한 플레이스홀더 */
}

.stock-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
    background-color: rgba(255,255,255,0.9);
}

.dropdown-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.dropdown-results.show {
    display: block;
}

.dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    color: #2d3748;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: flex-start;  /* 왼쪽 정렬 (기존: space-between) */
    align-items: center;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item.highlighted {
    background-color: rgba(102, 126, 234, 0.2);
}

.dropdown-item-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 16px;
}

/* 종목코드 별도 스타일은 제거 (한 줄로 표시하므로) */
.dropdown-item-code {
    display: none;  /* 별도 표시 안함 */
}

/* 4. 드롭다운 스크롤바 커스텀 - 빨간색, 두께 2배 */
.dropdown-results::-webkit-scrollbar {
    width: 12px;  /* 두께 2배 (기존: 6px) */
}

.dropdown-results::-webkit-scrollbar-track {
    background: rgba(255, 200, 200, 0.3);  /* 연한 빨간색 배경 */
    border-radius: 6px;
}

.dropdown-results::-webkit-scrollbar-thumb {
    background: #c53030;  /* 빨간색 스크롤바 */
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.3);
}

.dropdown-results::-webkit-scrollbar-thumb:hover {
    background: #dc2626;  /* 호버시 더 진한 빨간색 */
}

.search-label {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748; /* 진한 글자색 */
    white-space: nowrap;
}

.stocks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stock-card {
    background: rgba(255,255,255,0.7); /* 더 진한 배경 */
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    color: #2d3748; /* 진한 글자색 */
}

.stock-card.edit-mode {
    background: rgba(255,255,255,0.9); /* 편집 모드 시 더 진한 배경 */
    border: 2px solid #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    cursor: default;
}

.stock-card.edit-mode::before {
    content: "✏️ 편집 모드 - 값을 수정하고 저장을 누르세요";
    position: absolute;
    top: -35px;
    left: 0;
    right: 0;
    background: #667eea;
    color: white;
    padding: 8px;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    z-index: 10;
}

.stock-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    background: rgba(255,255,255,0.8);
}

.stock-header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stock-title-group {
    flex: 1;
    display: flex;
    align-items: baseline;
}

.stock-name {
    font-size: 20px; /* 20px 유지 */
    font-weight: bold;
    display: flex;
    align-items: baseline;
    color: #2d3748; /* 진한 글자색 */
}

.stock-code {
    font-size: 16px;
    opacity: 0.7;
    background: rgba(102, 126, 234, 0.2);
    color: #4a5568; /* 중간 회색 */
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 8px;
    display: inline-block;
    font-weight: normal;
}

.editable-value {
    transition: all 0.3s ease;
}

.edit-input {
    background: rgba(255,255,255,0.9);
    color: #2d3748; /* 진한 글자색 */
    border: 2px solid #667eea;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 16px; /* 15px → 16px */
    font-weight: inherit;
    text-align: right;
    width: 100%;
    box-sizing: border-box;
}

.edit-input:focus {
    outline: none;
    border-color: #4c51bf;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.edit-buttons {
    display: none;
    justify-content: center;
    gap: 8px;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 20;
}

.edit-mode .edit-buttons {
    display: flex;
}

.edit-btn-action {
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.save-btn {
    background: #10b981;
    color: white;
}

.save-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.cancel-btn {
    background: rgba(102, 126, 234, 0.2);
    color: #2d3748; /* 진한 글자색 */
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.cancel-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.delete-btn {
    background: #ef4444;
    color: white;
}

.delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.stock-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-size: 16px; /* 15px → 16px */
    opacity: 0.8;
    flex-shrink: 0;
    color: #4a5568; /* 중간 회색 */
}

.divider {
    border-top: 0.5px solid #5a6578; /* 중간 회색 */
}

.info-value {
    font-size: 16px; /* 15px → 16px */
    font-weight: 600;
    text-align: right;
    flex-grow: 1;
    margin-left: 10px;
    color: #2d3748; /* 진한 글자색 */
}

.stock-profit {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 15px;
}

.profit-period {
    text-align: center;
    padding: 10px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.7); /* 더 진한 배경 */
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.profit-period:hover {
    background: rgba(255,255,255,0.8);
    transform: translateY(-2px);
}

.period-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 4px;
    font-weight: 500;
    color: #4a5568; /* 중간 회색 */
}

.profit-amount {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 2px;
    /* 기본 색상 제거 - 조건부 색상으로 대체 */
}

.profit-rate {
    font-size: 14px; /* % 포함된 수익률은 14px */
    font-weight: 600;
}

.period-yesterday { border-left: 3px solid #60a5fa; }
.period-week { border-left: 3px solid #34d399; }
.period-total { border-left: 3px solid #fbbf24; }

.empty-portfolio {
    text-align: center;
    padding: 60px 20px;
    opacity: 0.7;
    color: #4a5568; /* 중간 회색 */
}

.empty-icon {
    font-size: 50px;
    margin-bottom: 20px;
}

.empty-message {
    font-size: 20px; /* 20px 유지 */
    margin-bottom: 10px;
}

.empty-guide {
    font-size: 16px;
    opacity: 0.8;
}

/* 합쳐진 카드 내부 스타일 */
#totalInvestmentValuation,
#totalProfitCombined {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 투자/평가 금액 카드 - 평가금액이 더 크게 */
#totalInvestmentValuation div:first-child {
    font-size: 16px;
    opacity: 0.8;
    color: #4a5568; /* 중간 회색 */
}

#totalInvestmentValuation div:last-child {
    font-size: 22px; /* 22px 유지 */
    font-weight: bold;
    color: #2d3748; /* 진한 글자색 */
}

/* 총 수익 카드 */
#totalProfitCombined div:first-child {
    font-size: 18px; /* 18px 유지 */
    color: #2d3748; /* 진한 글자색 */
}

#totalProfitCombined div:last-child {
    font-size: 14px; /* % 포함된 수익률은 14px */
    opacity: 0.9;
}

/* 어제 대비, 일주일 대비 수익률 줄바꿈 */
.yesterday-change, .week-change {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.yesterday-change .change-amount,
.week-change .change-amount {
    font-size: 16px;
    font-weight: bold;
    color: #2d3748; /* 진한 글자색 */
}

.yesterday-change .change-rate,
.week-change .change-rate {
    font-size: 14px; /* % 포함된 수익률은 14px */
    opacity: 0.9;
}

/* 어제 대비 수익률 색상 */
.yesterday-change .change-amount.profit-positive,
.yesterday-change .change-rate.profit-positive {
    color: #c53030; /* 빨간색 (기존: #1e3a8a 파란색) */
}

.yesterday-change .change-amount.profit-negative,
.yesterday-change .change-rate.profit-negative {
    color: #1e3a8a; /* 파란색 (기존: #c53030 빨간색) */
}

/* 일주일 대비 수익률 색상 */
.week-change .change-amount.profit-positive,
.week-change .change-rate.profit-positive {
    color: #c53030; /* 빨간색 (기존: #1e3a8a 파란색) */
}

.week-change .change-amount.profit-negative,
.week-change .change-rate.profit-negative {
    color: #1e3a8a; /* 파란색 (기존: #c53030 빨간색) */
}

/* 총 수익 (구매 후) 색상 */
.profit-amount.profit-positive {
    color: #c53030 !important; /* 빨간색 (기존: #1e3a8a 파란색) */
}

.profit-amount.profit-negative {
    color: #1e3a8a !important; /* 파란색 (기존: #c53030 빨간색) */
}

.profit-rate.profit-positive {
    color: #c53030 !important; /* 빨간색 (기존: #1e3a8a 파란색) */
}

.profit-rate.profit-negative {
    color: #1e3a8a !important; /* 파란색 (기존: #c53030 빨간색) */
}

/* 메모 영역 스타일 */
.stock-memo {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.memo-container {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.memo-textarea {
    flex: 1;
    height: 56px;
    padding: 8px 10px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    background: rgba(255,255,255,0.8);
    color: #2d3748;
    font-size: 16px;
    font-family: 'Malgun Gothic', '맑은 고딕', Arial, sans-serif;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.memo-textarea::placeholder {
    color: rgba(45, 55, 72, 0.5);
    font-size: 14px;
}

.memo-textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    background: rgba(255,255,255,0.95);
}

.memo-save-btn {
    width: 50px;
    height: 56px;
    padding: 0;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    background: rgba(102, 126, 234, 0.1);
    color: #2d3748;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

.memo-save-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    transform: translateY(-1px);
}

.memo-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.memo-save-btn.saving {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 편집 모드에서 메모 영역 스타일 조정 */
.edit-mode .memo-textarea {
    background: rgba(255,255,255,0.95);
    border-color: #667eea;
}

.edit-mode .memo-save-btn {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

/* 데모 카드 스타일 (welcome.html용) */
.demo-card {
    cursor: default !important;
    opacity: 0.8;
}

.demo-card:hover {
    transform: none !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
}

#demoInvestmentValuation,
#demoTotalProfit {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#demoInvestmentValuation div:first-child {
    font-size: 16px;
    opacity: 0.8;
    color: #4a5568; /* 중간 회색 */
}

#demoInvestmentValuation div:last-child {
    font-size: 22px; /* 22px 유지 */
    font-weight: bold;
    color: #2d3748; /* 진한 글자색 */
}

#demoTotalProfit div:first-child {
    font-size: 18px; /* 18px 유지 */
    color: #2d3748; /* 진한 글자색 */
}

#demoTotalProfit div:last-child {
    font-size: 14px; /* % 포함된 수익률은 14px */
    opacity: 0.9;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    /* 전체 body 여백 완전 제거 */
    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;  /* auto에서 hidden으로 변경 */
    }
    
    /* 네비게이션 바 여백 조정 */
    .navbar {
        padding: 10px 8px;
        margin: 0;
    }
    
    /* 컨테이너 여백 제거 */
    .container {
        padding: 2px 2px;
        margin: 0;
        max-width: 100%;
    }
    
    .portfolio-container {
        padding: 15px 3px;
        margin: 5px 0;
        border-radius: 10px;
        overflow-x: hidden;
    }
    
    /* 종목 상세 정보 영역 반응형 개선 */
    .stock-detail-container {
        overflow: visible;  /* 스크롤 가능하게 */
        margin: 10px 0;
        border-radius: 10px;
        width: 100%;
        max-width: 100%;
        padding: 0;  /* 패딩 제거 */
    }
    
    /* iframe 모바일 최적화 */
    .stock-detail-container iframe {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 500px;
        height: auto;
    }
    
    /* iframe 내부 콘텐츠가 보이도록 */
    .stock-detail-container > * {
        max-width: 100% !important;
        overflow-x: auto !important;
    }
    
    /* stocks-grid 관련 스타일 유지 */
    .stocks-grid {
        grid-template-columns: 1fr;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .stock-card {
        min-width: 320px;
        overflow-x: auto;
        padding: 15px;
    }
    
    .stock-info {
        overflow-x: auto;
        min-width: 290px;
    }
    
    .info-item {
        min-width: 270px;
        white-space: nowrap;
    }
    
    .stock-profit {
        overflow-x: auto;
        min-width: 290px;
        padding-bottom: 5px;
    }
    
    .profit-period {
        min-width: 85px;
        flex-shrink: 0;
    }

    .portfolio-header {
        flex-direction: column;
        gap: 15px;
    }

    .user-info-section {
        margin-left: 0;
        margin-top: 10px;
    }

    .stock-search-section {
        flex-direction: column;
        align-items: stretch;
    }

    .searchable-dropdown {
        max-width: none;
    }
    
    .dropdown-results {
        max-height: 135px;
    }

    .dropdown-results::-webkit-scrollbar {
        width: 10px;  /* 모바일에서는 조금 얇게 */
    }
    
    .dropdown-item {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .dropdown-item-code {
        align-self: flex-end;
    }
    
    /* 메모 영역 모바일 최적화 */
    .memo-container {
        gap: 6px;
    }
    
    .memo-textarea {
        font-size: 14px;
        height: 48px;
        padding: 6px 8px;
    }
    
    .memo-save-btn {
        width: 45px;
        height: 48px;
        font-size: 11px;
    }
    
    /* 스크롤바 스타일링 */
    .stock-card::-webkit-scrollbar,
    .stock-info::-webkit-scrollbar,
    .stock-profit::-webkit-scrollbar,
    .stocks-grid::-webkit-scrollbar,
    .stock-detail-container::-webkit-scrollbar {
        height: 6px;
        width: 6px;
    }
    
    .stock-card::-webkit-scrollbar-track,
    .stock-info::-webkit-scrollbar-track,
    .stock-profit::-webkit-scrollbar-track,
    .stocks-grid::-webkit-scrollbar-track,
    .stock-detail-container::-webkit-scrollbar-track {
        background: rgba(255,255,255,0.1);
        border-radius: 3px;
    }
    
    .stock-card::-webkit-scrollbar-thumb,
    .stock-info::-webkit-scrollbar-thumb,
    .stock-profit::-webkit-scrollbar-thumb,
    .stocks-grid::-webkit-scrollbar-thumb,
    .stock-detail-container::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.3);
        border-radius: 3px;
    }
    
    .stock-card::-webkit-scrollbar-thumb:hover,
    .stock-info::-webkit-scrollbar-thumb:hover,
    .stock-profit::-webkit-scrollbar-thumb:hover,
    .stocks-grid::-webkit-scrollbar-thumb:hover,
    .stock-detail-container::-webkit-scrollbar-thumb:hover {
        background: rgba(255,255,255,0.5);
    }
}

/* ===== 주식 추가 모달 스타일 (2025-01-20 추가) ===== */
.custom-modal {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

.current-price-info {
    background: #f0f8ff;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    color: #0066cc;
    font-weight: bold;
}

.modal-body .input-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.modal-body .input-group label {
    flex: 0 0 100px;
    font-weight: 500;
}

.modal-body .input-group input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.modal-body .input-suffix {
    margin-left: 10px;
    color: #666;
}

.modal-body .required {
    color: red;
}

.investment-preview {
    background: #fffbf0;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    text-align: center;
    border: 1px solid #ffd700;
}

.investment-preview label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

#investmentPreview {
    font-size: 1.3em;
    font-weight: bold;
    color: #ff6b00;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel, .btn-confirm {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-confirm {
    background: #4CAF50;
    color: white;
}

.btn-confirm:hover {
    background: #45a049;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
    }
    
    .modal-body .input-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal-body .input-group label {
        flex: none;
        margin-bottom: 5px;
    }
    
    .modal-body .input-group input {
        width: 100%;
    }
}