/* v2.0 - 실거래 분석 결과 스타일 */
.result-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.result-header h2 {
    font-size: 26px;
    color: #2d3748;
    margin-bottom: 8px;
    font-weight: 700;
}

.result-header p {
    font-size: 14px;
    color: #718096;
}

.file-type-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid;
}

.file-type-badge.apartment {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #90caf9;
}

.file-type-badge.villa {
    background: #f3e5f5;
    color: #7b1fa2;
    border-color: #ce93d8;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 30px 0;
}

.result-card {
    background: #f7fafc;
    padding: 28px 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
    transition: all 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.result-card-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.85;
}

.result-card label {
    display: block;
    font-size: 11px;
    color: #718096;
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.result-card .value {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.2;
}

/* 탭 스타일 */
.tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin: 30px 0 20px 0;
    gap: 4px;
    flex-wrap: wrap;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    padding: 4px;
}

.tab-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    border-radius: 6px;
    transition: all 0.2s;
    position: relative;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.tab-btn.active {
    color: #667eea;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.tab-content {
    display: none;
    padding: 20px 0;
}

.tab-content.active {
    display: block;
}

/* 테이블 컨트롤 */
.table-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 15px;
}

.table-controls label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.table-controls select {
    padding: 4px 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    cursor: pointer;
    min-width: 60px !important;
    max-width: 80px !important;
    height: auto !important;
    width: auto !important;
    background-size: 8px !important;
    background-position: right 6px center !important;
    padding-right: 24px !important;
}

/* 테이블 스타일 */
.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
}

.analysis-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.analysis-table thead {
    background: #667eea;
    color: white;
}

.analysis-table th {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.analysis-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.analysis-table th.sortable:hover {
    background: #5568d3;
}

.sort-icon {
    margin-left: 5px;
    font-size: 12px;
}

.analysis-table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.analysis-table tbody tr:hover {
    background: #f8f9fa;
}

/* 분포 그리드 */
.distribution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.dist-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dist-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.dist-value {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.dist-percent {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.dist-bar {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.dist-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.dist-bar-fill.age {
    background: linear-gradient(90deg, #f39c12 0%, #e74c3c 100%);
}

.dist-bar-fill.price {
    background: linear-gradient(90deg, #2ecc71 0%, #27ae60 100%);
}

/* 검색 박스 */
.search-box {
    margin: 20px 0;
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

#searchCount {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #667eea;
}

.info-box {
    margin-top: 30px;
    padding: 20px;
    background: #e8f4f8;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.info-box h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box li {
    padding: 5px 0;
}

.info-box a {
    color: #3498db;
    text-decoration: none;
}

.info-box a:hover {
    text-decoration: underline;
}

small {
    display: block;
    margin-top: 5px;
    color: #666;
    line-height: 1.4;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.action-buttons button,
.action-buttons a {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 페이징 스타일 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: bold;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 지역 상세 분포 테이블 */
.distribution-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.distribution-table thead {
    background: #667eea;
    color: white;
}

.distribution-table th {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid #5568d3;
}

.distribution-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.distribution-table th.sortable:hover {
    background: #5568d3;
}

.distribution-table th .sort-icon {
    margin-left: 3px;
    font-size: 11px;
}

.distribution-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #eee;
    font-size: 13px;
}

.distribution-table .region-name {
    background: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding-left: 15px;
}

.distribution-table .max-value {
    background: #fff3cd;
    font-weight: bold;
    color: #856404;
}

.distribution-table tbody tr:hover {
    background: #f8f9fa;
}

.distribution-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.distribution-table tbody tr:nth-child(even):hover {
    background: #e9ecef;
}

.distribution-table tbody tr:nth-child(even) .max-value {
    background: #ffe5a0;
}

#tab-average h4,
#tab-regional h4 {
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    color: #333;
}

#tab-average h4:first-of-type,
#tab-regional h4:first-of-type {
    margin-top: 20px;
}

/* 검색 방법 탭 스타일 */
.search-method-tabs {
    display: flex;
    width: 100%;
    gap: 0;
    margin-bottom: 25px;
    background: #f1f3f5;
    padding: 5px;
    border-radius: 14px;
    border: 1px solid #e9ecef;
}

.method-tab {
    flex: 1;
    padding: 18px 0;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.15em;
    font-weight: 700;
    color: #868e96;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.method-tab:hover {
    color: #495057;
    background: rgba(0,0,0,0.03);
}

.method-tab.active {
    color: var(--theme-dark);
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    font-weight: 800;
    z-index: 1;
}

.tab-icon {
    font-size: 1.2em;
    margin-bottom: 2px;
}

.premium-badge-small {
    display: inline-block;
    padding: 4px 8px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: 800;
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.method-tab-content {
    display: none;
}

.method-tab-content.active {
    display: block;
}

.address-search-form .filter-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.address-search-form .filter-group {
    flex: 1;
}

.address-search-form .filter-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

@media (max-width: 768px) {
    .search-method-tabs {
        flex-direction: column;
        gap: 8px;
        height: auto;
    }
    
    .method-tab {
        width: 100%;
        padding: 12px;
    }
        
    .address-search-form .filter-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .address-search-form .filter-group {
        flex: auto !important;
        width: 100%;
    }

    /* Result Tabs Mobile Style */
    .tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        border-bottom: none;
        margin: 20px 0;
    }

    .tab-btn {
        width: 100%;
        text-align: center;
        background: #f8f9fa;
        border-radius: 8px;
        padding: 12px 5px;
        font-size: 14px;
        border: 1px solid #e2e8f0;
        color: #4a5568;
        border-bottom: 1px solid #e2e8f0;
    }

    .tab-btn.active {
        background: #667eea;
        color: white;
        border-color: #667eea;
        border-bottom-color: #667eea;
        font-weight: bold;
        box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
    }
}

/* Force 3 columns for info cards on desktop */
@media (min-width: 1024px) {
    .info-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 프리미엄 잠금 오버레이 */
.premium-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(3px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.lock-message {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    max-width: 80%;
}

.lock-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.lock-message h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.lock-message p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.btn-premium {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s;
}

.btn-premium:hover {
    transform: translateY(-2px);
}
