/* Stock/stock.css */

.stock-container {
    width: 100%;
    max-width: 1000px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.action-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.fetch-btn {
    background: linear-gradient(135deg, #05c074, #009d5a);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(5, 192, 116, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fetch-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(5, 192, 116, 0.3);
}

.fetch-btn:active {
    transform: translateY(1px);
}

.fetch-btn:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.table-wrapper {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 0 1.5rem 1.5rem 1.5rem; /* 상단 패딩 제거 */
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.05);
    overflow-x: auto;
    max-height: 650px;
    overflow-y: auto;
}

/* ... (스크롤바 스타일 유지) ... */

.stock-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: right;
    min-width: 800px;
}

.stock-table th, .stock-table td {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.stock-table th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f8fafc; /* 배경색 고정 */
    position: sticky;
    top: 0;
    z-index: 10;
    padding-top: 1.5rem; /* 타이틀 상단에 여백 추가 */
    padding-bottom: 1rem;
}

.stock-table th:first-child, .stock-table td:first-child {
    text-align: left;
}

.stock-table td {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1rem;
    transition: background 0.3s ease;
}

.stock-table tbody tr {
    transition: transform 0.2s ease, background 0.2s ease;
}

.stock-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-radius: 10px;
}

.stock-table tbody tr:hover td {
    border-bottom-color: transparent;
}

.stock-name-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.up { color: #ef4444 !important; }
.down { color: #3b82f6 !important; }
.steady { color: #64748b !important; }

/* Loader */
.loader-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1.5rem;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(5, 192, 116, 0.2);
    border-top-color: #05c074;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    line-height: 1.5;
}

.error-message {
    display: none;
    background: rgba(254, 226, 226, 0.8);
    color: #b91c1c;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #f87171;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-weight: 500;
}
