/**
 * DarkFina - 기관 동향 페이지 전용 스타일
 */

/* ========================================
   기관 컨텐츠 영역
======================================== */
.institution-content {
    display: flex;
    flex-direction: column;
}

.institution-content > * {
    margin-bottom: 20px;
}

.institution-content > *:last-child {
    margin-bottom: 0;
}

/* ========================================
   기관 상태 카드
======================================== */
.institution-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.institution-stat-card {
    background: var(--df-bg-secondary);
    border: 1px solid var(--df-border);
    border-radius: 12px;
    padding: 20px;
}

.institution-stat-card h4 {
    color: var(--df-cyan);
    margin-bottom: 16px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.institution-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.institution-stat-row .label {
    color: var(--df-text-secondary);
    font-size: 14px;
}

.institution-stat-row .value {
    font-weight: 600;
    font-size: 15px;
}

/* ========================================
   요약 통계 카드
======================================== */
.institution-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
}

.summary-stat-item {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 14px 10px;
    text-align: center;
    min-width: 0;
}

.summary-stat-item .period {
    color: var(--df-text-secondary);
    font-size: 12px;
    margin-bottom: 8px;
}

.summary-stat-item .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--df-cyan);
    word-break: break-word;
}

.summary-stat-item .value.bullish {
    color: var(--df-green);
}

.summary-stat-item .value.bearish {
    color: var(--df-pink);
}

@media (max-width: 600px) {
    .institution-summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-stat-item .value {
        font-size: 16px;
    }
}

@media (max-width: 400px) {
    .institution-summary-stats {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   히스토리 차트
======================================== */
.institution-chart-container {
    background: var(--df-bg-secondary);
    border: 1px solid var(--df-border);
    border-radius: 12px;
    padding: 20px;
}

.institution-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.institution-chart-header h4 {
    color: var(--df-cyan);
    margin: 0;
}

.chart-period-buttons {
    display: flex;
    gap: 8px;
}

.chart-period-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--df-border);
    border-radius: 6px;
    color: var(--df-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.chart-period-btn:hover {
    border-color: var(--df-purple);
    color: var(--df-purple);
}

.chart-period-btn.active {
    background: var(--df-purple);
    color: #fff;
    border-color: var(--df-purple);
}

@media (max-width: 768px) {
    .chart-period-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   상위 보유자 테이블
======================================== */
.top-holders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.top-holders-header h4 {
    color: var(--df-cyan);
    margin: 0;
}

.holders-table {
    width: 100%;
    border-collapse: collapse;
}

.holders-table th {
    background: var(--df-bg-card);
    color: var(--df-cyan);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--df-border);
    font-size: 13px;
}

.holders-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 14px;
}

.holders-table tr:hover {
    background: rgba(138, 43, 226, 0.05);
}

.holder-name {
    font-weight: 600;
    color: var(--df-text-primary);
}

.holder-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.holder-type-hedge {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.holder-type-mutual {
    background: rgba(0, 191, 255, 0.2);
    color: #00bfff;
}

.holder-type-pension {
    background: rgba(50, 205, 50, 0.2);
    color: #32cd32;
}

.holder-type-other {
    background: rgba(128, 128, 128, 0.2);
    color: #888;
}

.holder-type-new {
    background: rgba(0, 212, 255, 0.2);
    color: var(--df-cyan);
}

.holder-type-add {
    background: rgba(0, 255, 136, 0.2);
    color: var(--df-green);
}

.holder-type-reduce {
    background: rgba(255, 107, 107, 0.2);
    color: var(--df-red);
}

/* ========================================
   최근 변동 내역
======================================== */
.changes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.changes-header h4 {
    color: var(--df-cyan);
    margin: 0;
}

.load-changes-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--df-purple), var(--df-cyan));
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.load-changes-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

.load-changes-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.changes-table {
    width: 100%;
    border-collapse: collapse;
}

.changes-table th {
    background: var(--df-bg-card);
    color: var(--df-cyan);
    padding: 10px;
    text-align: right;
    font-size: 12px;
}

.changes-table th:first-child {
    text-align: left;
}

.changes-table td {
    padding: 10px;
    text-align: right;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
}

.changes-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.change-positive {
    color: var(--df-green);
}

.change-negative {
    color: var(--df-pink);
}

/* ========================================
   헤지펀드 포지션
======================================== */
.hedge-fund-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.hedge-fund-item {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 16px;
}

.hedge-fund-item .name {
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 8px;
}

.hedge-fund-item .position {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.hedge-fund-item .label {
    color: var(--df-text-secondary);
    font-size: 12px;
}

.hedge-fund-item .value {
    font-weight: 600;
    font-size: 14px;
}

/* ========================================
   로딩 상태
======================================== */
.institution-loading {
    text-align: center;
    padding: 40px;
    color: var(--df-text-secondary);
}

.institution-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--df-border);
    border-top-color: var(--df-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* ========================================
   데이터 없음 상태
======================================== */
.no-data {
    text-align: center;
    padding: 40px;
    color: var(--df-text-muted);
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
}

.no-data-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}
