@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;600;700&display=swap');

* {
    box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif;
}

body {
    margin: 0;
    background: linear-gradient(135deg, #0f172a, #020617);
    color: #f8fafc;
}

/* 전체 레이아웃 */
.container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    gap: 30px;
    padding: 40px 20px;
}

/* 메인 영역 */
.main-area {
    flex: 2;
}

.main-area h1 {
    font-size: 26px;
    margin-bottom: 25px;
    border-left: 5px solid #38bdf8;
    padding-left: 12px;
}

/* 카드 */
.stock-card {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 18px;
    transition: all .2s;
}

.stock-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,.4);
}

.stock-title {
    font-size: 20px;
    font-weight: 700;
}

.stock-meta {
    margin-top: 5px;
    font-size: 14px;
    color: #94a3b8;
}

.stock-price {
    margin-top: 12px;
    font-size: 18px;
    font-weight: 600;
}

.stock-summary {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.6;
    color: #e2e8f0;
}

/* 상승/하락 컬러 */
/* 상승 = 빨강 / 하락 = 파랑 / 동일 = 회색 */
.up {
    color: #ef4444; /* 빨강 */
    font-weight: 700;
}

.down {
    color: #2563eb; /* 파랑 */
    font-weight: 700;
}

.same {
    color: #9ca3af; /* 회색 */
    font-weight: 600;
}


/* 페이징 */
.pagination {
    margin-top: 30px;
}

.pagination a {
    display: inline-block;
    padding: 8px 14px;
    margin-right: 6px;
    background: #020617;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #cbd5f5;
    text-decoration: none;
    font-weight: 500;
}

.pagination a:hover,
.pagination a.active {
    background: #38bdf8;
    color: #020617;
    border-color: #38bdf8;
}

/* 오른쪽 서브 영역 */
.side-area {
    flex: 0.8;
    background: rgba(2, 6, 23, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 18px;
    padding: 20px;
    height: 820px;
    display: flex;
    flex-direction: column;
}

.side-area h2 {
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 1px solid #334155;
    padding-bottom: 10px;
}

/* 스크롤 영역 */
.side-scroll {
    overflow-y: auto;
    padding-right: 6px;
}

/* 개별 항목 */
.side-item {
    background: #020617;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}

.side-title {
    font-weight: 700;
    font-size: 15px;
}

.side-price,
.side-current {
    font-size: 14px;
    margin-top: 4px;
}

/* 스크롤바 스타일 */
.side-scroll::-webkit-scrollbar {
    width: 6px;
}

.side-scroll::-webkit-scrollbar-thumb {
    background: #38bdf8;
    border-radius: 10px;
}

/* 카드 상단 정렬 */
.stock-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 자세히보기 버튼 */
.detail-btn {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #020617;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 20px;
    transition: all .2s;
}

.detail-btn:hover {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    transform: translateY(-1px);
}

/* 상세 페이지 본문 */
.detail-content {
    margin-top: 30px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px;
    padding: 26px;
}

.detail-content h3 {
    font-size: 18px;
    margin-bottom: 16px;
    border-left: 5px solid #38bdf8;
    padding-left: 10px;
}

.detail-content p {
    font-size: 15px;
    line-height: 1.8;
    color: #e5e7eb;
    margin-bottom: 14px;
}

/* 이전으로 버튼 (상단 고정) */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999;
    background: linear-gradient(135deg, #111827, #020617);
    border: 1px solid #334155;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
    transition: all .2s;
}

.back-btn:hover {
    background: #38bdf8;
    color: #020617;
    transform: translateX(-2px);
}

/* ✅ 상세 페이지 섹션 박스 */
.detail-section {
    margin-top: 30px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px;
    padding: 26px;
}

.detail-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    border-left: 5px solid #38bdf8;
    padding-left: 10px;
}

.detail-section p {
    font-size: 15px;
    line-height: 1.8;
}

/* 뉴스 */
.news-item {
    border-bottom: 1px solid #334155;
    padding: 12px 0;
}

.news-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.news-impact {
    font-size: 14px;
    color: #cbd5f5;
}

/* 경쟁사 */
.competitor-item {
    border-bottom: 1px solid #334155;
    padding: 12px 0;
}

.competitor-name {
    font-weight: 700;
    margin-bottom: 4px;
}

.competitor-comment {
    font-size: 14px;
    color: #cbd5f5;
}

/* 데이터 없음 */
.empty-text {
    color: #9ca3af;
    font-size: 14px;
}

/* ✅ 접근 차단 메시지 */
.expired-box {
    margin-top: 120px;
    background: rgba(127, 29, 29, 0.2);
    border: 1px solid #ef4444;
    color: #fecaca;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    padding: 40px;
    border-radius: 18px;
}

.side-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.side-link:hover .side-item {
    background: rgba(30, 64, 175, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    transition: 0.2s ease;
}