/* 관심종목 컨테이너 */
.stock-watchlist-container {
    background: #fff;
    border: 1px solid #e4e8eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    max-width: 1000px;
}

/* 헤더 */
.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
}

.stock-title {
    margin: 0;
    font-size: 1.4em;
    font-weight: 700;
    color: #333;
}

.add-stock-btn {
    background-color: #03c75a;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.add-stock-btn:hover {
    background-color: #02b350;
}

/* 종목 추가 폼 */
.stock-add-form-wrapper {
    background: #f9fafb;
    border: 1px solid #e4e8eb;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

/* 검색 섹션 */
.stock-search-section {
    margin-bottom: 20px;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: #03c75a;
    box-shadow: 0 0 0 3px rgba(3, 199, 90, 0.1);
}

/* 검색 결과 드롭다운 */
.f-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e4e8eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: -1px;
}

.f-search-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.f-search-item:hover {
    background-color: #f9fafb;
}

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

.f-search-item-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    font-size: 14px;
}

.f-search-item-code {
    font-size: 12px;
    color: #6b7280;
}

.f-search-item-type {
    display: inline-block;
    background: #e5e7eb;
    color: #374151;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
    font-weight: 500;
}

.f-search-loading,
.f-search-no-results {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.help-text {
    font-size: 0.9em;
    color: #6b7280;
    margin: 8px 0 0 0;
}

.help-text a {
    color: #03c75a;
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

/* 종목 추가 폼 */
.stock-add-form {
    padding-top: 15px;
    border-top: 1px solid #e4e8eb;
    margin-top: 15px;
}

.stock-add-form .form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.stock-add-form input[type="text"],
.stock-add-form input[type="number"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
}

.stock-add-form input[readonly] {
    background-color: #f3f4f6;
    color: #6b7280;
}

.stock-add-form input:focus:not([readonly]) {
    outline: none;
    border-color: #03c75a;
    box-shadow: 0 0 0 3px rgba(3, 199, 90, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
}

.submit-btn,
.cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.submit-btn {
    background-color: #03c75a;
    color: white;
}

.submit-btn:hover {
    background-color: #02b350;
}

.submit-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.cancel-btn {
    background-color: #e5e7eb;
    color: #374151;
}

.cancel-btn:hover {
    background-color: #d1d5db;
}

/* 빈 상태 */
.stock-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.stock-empty p {
    margin: 10px 0;
}

/* 주식 테이블 */
.stock-table {
    width: 100%;
}

.stock-table-header,
.stock-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1.2fr 0.8fr;
    gap: 15px;
    padding: 15px 10px;
    align-items: center;
}

.stock-table-header {
    background: #f9fafb;
    border-bottom: 2px solid #e4e8eb;
    font-weight: 700;
    color: #374151;
    font-size: 0.9em;
}

.stock-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.stock-row:hover {
    background-color: #f9fafb;
}

.stock-row:last-child {
    border-bottom: none;
}

/* 컬럼 스타일 */
.col-name strong {
    color: #111827;
    font-size: 1.05em;
}

.col-code {
    color: #6b7280;
    font-size: 0.9em;
}

.col-price {
    font-weight: 600;
    color: #111827;
}

.col-change {
    font-weight: 700;
}

/* 상승/하락 색상 */
.stock-positive {
    color: #d60000;
}

.stock-negative {
    color: #0051c7;
}

/* 삭제 버튼 */
.delete-stock-btn {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: background-color 0.3s;
}

.delete-stock-btn:hover {
    background-color: #dc2626;
}

/* 알림 메시지 */
.stock-notice {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    color: #92400e;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

/* 스크롤바 스타일 */
.f-search-dropdown::-webkit-scrollbar {
    width: 8px;
}

.f-search-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.f-search-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.f-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .stock-table-header,
    .stock-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .stock-table-header {
        display: none;
    }
    
    .stock-row > div::before {
        content: attr(data-label);
        font-weight: 700;
        margin-right: 10px;
        color: #6b7280;
    }
    
    .col-name::before { content: "종목명: "; }
    .col-code::before { content: "코드: "; }
    .col-price::before { content: "현재가: "; }
    .col-change::before { content: "등락률: "; }
    
    .col-action::before {
        display: none;
    }
    
    .stock-add-form .form-row {
        flex-direction: column;
    }
    
    .search-input-wrapper input {
        font-size: 16px; /* iOS 줌 방지 */
    }
}