.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: bold;
    color: #495057;
}

select {
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

.stock-table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: center; /* 모든 셀 가운데 정렬 */
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f5f5f5;
    font-weight: bold;
    cursor: pointer !important; /* 항상 포인터 커서가 보이도록 강제 */
    user-select: none; /* 텍스트 선택 방지 */
    position: relative; /* 정렬 화살표를 위한 상대 위치 설정 */
    padding-right: 20px; /* 화살표를 위한 여백 */
}

th:hover {
    background-color: #f0f0f0;
}

/* 정렬 화살표 스타일 */
th::after {
    content: '↕';
    position: absolute;
    right: 5px;
    opacity: 0.5;
}

th.sort-asc::after {
    content: '↑';
    opacity: 1;
}

th.sort-desc::after {
    content: '↓';
    opacity: 1;
}

tr:hover {
    background-color: #f9f9f9;
}

.number-cell {
    text-align: center; /* 숫자도 가운데 정렬 */
}

.rate-cell {
    color: #ff0000; /* 등락률 빨간색으로 변경 */
    font-weight: bold;
}

.nav-button {
    display: flex;
    justify-content: flex-end;
    gap: 10px;  /* 버튼 사이 간격 */
    margin: 20px;
}

.switch-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2e86de;  /* 급락주 버튼의 파란색 사용 */
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.switch-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.list-button {
    background-color: #808080;  /* 회색 */
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
}

.list-button:hover {
    background-color: #666666;  /* 호버 시 더 어두운 회색 */
}

/* 모바일 메뉴 버튼 스타일 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1001;
    font-size: 1rem;
}

/* 모바일 드롭다운 메뉴 스타일 */
.mobile-dropdown {
    display: none;
    position: fixed;
    top: 4rem;
    right: 1rem;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    overflow: hidden;
}

.mobile-dropdown.active {
    display: block;
}

.mobile-dropdown .menu-item {
    display: block;
    padding: 1rem 2rem;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
    white-space: nowrap;
    text-align: left;
}

.mobile-dropdown .menu-item:last-child {
    border-bottom: none;
}

.mobile-dropdown .menu-item:hover {
    background-color: #f5f5f5;
}

/* 데스크톱 사이드 메뉴 스타일 */
.desktop-menu {
    background-color: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}
/* 메뉴바 크기 수정 */
.desktop-menu .menu-content {
    width: 200px;
}

.desktop-menu h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
    text-align: center;
}

.desktop-menu .menu-item {
    display: block;
    padding: 0.8rem;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
    text-align: center;
}

.desktop-menu .menu-item:hover {
    background-color: #007bff;
    color: white;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .desktop-menu {
        display: none;
    }
    
    .container {
        margin-top: 4rem;
        padding: 1rem;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn,
    .mobile-dropdown,
    .mobile-menu-overlay {
        display: none;
    }
    
    @media (min-width: 769px) {
        .desktop-menu {
            display: block;
            position: absolute; /* 또는 static */
            left: 350px; /* 원하는 고정 위치로 설정 */
            top: 30px; /* 원하는 고정 위치로 설정 */
        }
    }
    
    .container {
        margin: 2rem auto;
    }
}