/* ============================================
   History Review Page - history.css
   Primary: #DC0000 | Dark: #1a1a1a
   ============================================ */

/* ---- Section 3: Filters ---- */

.hist-filters {
    background: #fff;
    padding: 30px 0 24px;
    border-bottom: 1px solid #f0f0f0;
}

.hist-filter-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.hist-filter-row:last-child {
    margin-bottom: 0;
}

.hist-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hist-filter-label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.hist-select {
    height: 38px;
    padding: 0 32px 0 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.hist-select:focus {
    border-color: #DC0000;
}

.hist-search-group {
    margin-left: auto;
    display: flex;
    gap: 0;
}

.hist-search-input {
    height: 38px;
    width: 200px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
}

.hist-search-input:focus {
    border-color: #DC0000;
}

.hist-search-btn {
    height: 38px;
    padding: 0 24px;
    background: #DC0000;
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.hist-search-btn:hover {
    background: #b00000;
}

.hist-date-input {
    height: 38px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
}

.hist-date-input:focus {
    border-color: #DC0000;
}

.hist-date-sep {
    font-size: 14px;
    color: #999;
    padding: 0 4px;
}

.hist-range-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.hist-range-btn {
    height: 34px;
    padding: 0 16px;
    border: 1px solid #ddd;
    border-radius: 17px;
    font-size: 13px;
    color: #666;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.hist-range-btn:hover {
    border-color: #DC0000;
    color: #DC0000;
}

.hist-range-btn.active {
    background: #DC0000;
    border-color: #DC0000;
    color: #fff;
}

/* ---- Section 4: Main Content ---- */

.hist-main {
    background: #f5f5f5;
    padding: 40px 0 60px;
}

.hist-content-wrapper {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.hist-left {
    flex: 1;
    min-width: 0;
}

/* ---- Chart Section ---- */

.hist-chart-section {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 24px;
}

.hist-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.hist-chart-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.hist-chart-actions {
    display: flex;
    gap: 12px;
}

.hist-chart-btn {
    height: 32px;
    padding: 0 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.hist-chart-btn:hover {
    border-color: #DC0000;
    color: #DC0000;
}

.hist-chart-area {
    width: 100%;
    height: 360px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.hist-chart-placeholder {
    text-align: center;
    color: #ccc;
}

.hist-chart-placeholder p {
    margin-top: 12px;
    font-size: 14px;
    color: #999;
}

.hist-chart-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.hist-stat-card {
    background: #fafafa;
    border-radius: 10px;
    padding: 24px;
    border: 1px solid #f0f0f0;
}

.hist-stat-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}

.hist-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #111;
    margin-bottom: 6px;
    line-height: 1.2;
}

.hist-stat-date {
    font-size: 13px;
    color: #bbb;
    margin-bottom: 10px;
}

.hist-stat-change {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.hist-stat-change.up {
    color: #DC0000;
}

.hist-stat-change.down {
    color: #00A261;
}

.hist-stat-note {
    font-size: 12px;
    color: #999;
}

/* ---- Data Table Section ---- */

.hist-table-section {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 24px;
}

.hist-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.hist-table-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.hist-export-btn {
    height: 34px;
    padding: 0 20px;
    border: 1px solid #DC0000;
    border-radius: 6px;
    font-size: 13px;
    color: #DC0000;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.hist-export-btn:hover {
    background: #DC0000;
    color: #fff;
}

.hist-table-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
}

.hist-data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.hist-data-table th {
    background: #fafafa;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: left;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}

.hist-data-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    white-space: nowrap;
}

.hist-data-table tr:hover {
    background: #fafafa;
}

.hist-data-table tr:last-child td {
    border-bottom: none;
}

.hist-val-up {
    color: #DC0000;
    font-weight: 500;
}

.hist-val-down {
    color: #00A261;
    font-weight: 500;
}

/* Pagination */

.hist-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-top: 10px;
    flex-wrap: wrap;
}

.hist-page-btn {
    height: 34px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    background: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.hist-page-btn:hover:not(.disabled) {
    border-color: #DC0000;
    color: #DC0000;
}

.hist-page-btn.disabled {
    color: #ccc;
    cursor: not-allowed;
    border-color: #eee;
}

.hist-page-num {
    width: 34px;
    height: 34px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    background: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.hist-page-num:hover {
    border-color: #DC0000;
    color: #DC0000;
}

.hist-page-num.active {
    background: #DC0000;
    border-color: #DC0000;
    color: #fff;
}

.hist-page-ellipsis {
    padding: 0 4px;
    color: #999;
    font-size: 13px;
}

.hist-page-info {
    font-size: 13px;
    color: #999;
    margin-left: 12px;
}

/* ---- Product Comparison Section ---- */

.hist-compare-section {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 24px;
}

.hist-compare-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.hist-compare-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.hist-compare-period {
    height: 34px;
    padding: 0 18px;
    border: 1px solid #ddd;
    border-radius: 17px;
    font-size: 13px;
    color: #666;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.hist-compare-period:hover {
    border-color: #DC0000;
    color: #DC0000;
}

.hist-compare-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.hist-compare-card {
    background: #fafafa;
    border-radius: 10px;
    padding: 24px 20px;
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hist-compare-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.hist-compare-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}

.hist-compare-value {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
    line-height: 1.2;
}

.hist-compare-change {
    font-size: 14px;
    font-weight: 600;
}

.hist-compare-change.up {
    color: #DC0000;
}

.hist-compare-change.down {
    color: #00A261;
}

/* ---- SEO Content Section ---- */

.hist-seo-section {
    background: #fff;
    border-radius: 12px;
    padding: 36px 30px;
    margin-bottom: 24px;
}

.hist-seo-section h2 {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin-bottom: 24px;
    line-height: 1.4;
}

.hist-seo-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-top: 28px;
    margin-bottom: 14px;
}

.hist-seo-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #444;
    margin-top: 20px;
    margin-bottom: 10px;
}

.hist-seo-section p {
    font-size: 15px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 12px;
}

/* ---- Bottom Tags ---- */

.hist-bottom-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 0;
}

.hist-tag-item {
    display: inline-block;
    padding: 8px 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
}

.hist-tag-item:hover {
    background: #DC0000;
    border-color: #DC0000;
    color: #fff;
}

/* ---- Sidebar ---- */

.hist-sidebar {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hist-sidebar-block {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
}

.hist-sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
}

/* Live Quotes */

.hist-quote-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hist-quote-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
}

.hist-quote-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hist-quote-item:first-child {
    padding-top: 0;
}

.hist-quote-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hist-quote-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.hist-quote-code {
    font-size: 12px;
    color: #999;
}

.hist-quote-data {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hist-quote-price {
    font-size: 20px;
    font-weight: 700;
    color: #111;
}

.hist-quote-change {
    font-size: 13px;
    font-weight: 500;
}

.hist-quote-change.up {
    color: #DC0000;
}

.hist-quote-change.down {
    color: #00A261;
}

/* Hot Tags */

.hist-hot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hist-hot-tag {
    display: inline-block;
    padding: 6px 14px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
}

.hist-hot-tag:hover {
    background: #DC0000;
    color: #fff;
}

/* Hot Articles */

.hist-hot-articles {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hist-hot-articles li a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    transition: color 0.2s;
}

.hist-hot-articles li:last-child a {
    border-bottom: none;
}

.hist-hot-articles li a:hover {
    color: #DC0000;
}

.hist-article-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #D4AF37;
    flex-shrink: 0;
    margin-top: 1px;
}

.hist-article-num.hot {
    background: #FF4444;
}

/* History Prices */

.hist-price-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hist-price-list li a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    transition: color 0.2s;
}

.hist-price-list li:last-child a {
    border-bottom: none;
}

.hist-price-list li a:hover {
    color: #DC0000;
}

.hist-price-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: #DC0000;
    margin-top: 6px;
    flex-shrink: 0;
}

/* ============================================
   Responsive: max-width 1080px (Tablet + Mobile)
   ============================================ */

@media (max-width: 1080px) {

    /* Filters */
    .hist-filters {
        padding: 4vw 0;
    }

    .hist-filter-row {
        gap: 3vw;
    }

    .hist-filter-label {
        font-size: 3vw;
    }

    .hist-select {
        height: 9vw;
        font-size: 3vw;
        padding: 0 8vw 0 3vw;
    }

    .hist-search-group {
        width: 100%;
        margin-left: 0;
    }

    .hist-search-input {
        flex: 1;
        width: auto;
        height: 9vw;
        font-size: 3vw;
    }

    .hist-search-btn {
        height: 9vw;
        padding: 0 5vw;
        font-size: 3vw;
    }

    .hist-date-input {
        height: 9vw;
        font-size: 3vw;
        padding: 0 2vw;
    }

    .hist-date-sep {
        font-size: 3vw;
    }

    .hist-range-btns {
        margin-left: 0;
        flex-wrap: wrap;
        gap: 2vw;
    }

    .hist-range-btn {
        height: auto;
        padding: 1.5vw 3.5vw;
        font-size: 3vw;
    }

    /* Main Content */
    .hist-main {
        padding: 4vw 0 8vw;
    }

    .hist-content-wrapper {
        flex-direction: column;
        gap: 4vw;
    }

    .hist-left {
        width: 100%;
    }

    /* Chart */
    .hist-chart-section {
        padding: 4vw;
        border-radius: 3vw;
        margin-bottom: 4vw;
    }

    .hist-chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 3vw;
        margin-bottom: 4vw;
    }

    .hist-chart-title {
        font-size: 4.5vw;
    }

    .hist-chart-actions {
        gap: 2vw;
    }

    .hist-chart-btn {
        height: auto;
        padding: 1.5vw 3vw;
        font-size: 3vw;
    }

    .hist-chart-area {
        height: 50vw;
        margin-bottom: 4vw;
    }

    .hist-chart-stats {
        grid-template-columns: 1fr;
        gap: 3vw;
    }

    .hist-stat-card {
        padding: 4vw;
    }

    .hist-stat-value {
        font-size: 7vw;
    }

    .hist-stat-change {
        font-size: 4vw;
    }

    /* Table */
    .hist-table-section {
        padding: 4vw;
        border-radius: 3vw;
        margin-bottom: 4vw;
    }

    .hist-table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 3vw;
    }

    .hist-table-header h3 {
        font-size: 4.5vw;
    }

    .hist-data-table {
        min-width: 600px;
    }

    .hist-data-table th,
    .hist-data-table td {
        padding: 2.5vw 2vw;
        font-size: 3vw;
    }

    .hist-pagination {
        gap: 1.5vw;
    }

    .hist-page-btn {
        height: auto;
        padding: 1.5vw 3vw;
        font-size: 3vw;
    }

    .hist-page-num {
        width: 8vw;
        height: 8vw;
        font-size: 3vw;
    }

    .hist-page-info {
        font-size: 3vw;
        margin-left: 2vw;
    }

    /* Compare */
    .hist-compare-section {
        padding: 4vw;
        border-radius: 3vw;
        margin-bottom: 4vw;
    }

    .hist-compare-header h3 {
        font-size: 4.5vw;
    }

    .hist-compare-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 3vw;
    }

    .hist-compare-card {
        padding: 4vw 3vw;
    }

    .hist-compare-value {
        font-size: 6vw;
    }

    .hist-compare-label {
        font-size: 3vw;
    }

    .hist-compare-change {
        font-size: 3.2vw;
    }

    /* SEO */
    .hist-seo-section {
        padding: 4vw;
        border-radius: 3vw;
        margin-bottom: 4vw;
    }

    .hist-seo-section h2 {
        font-size: 5vw;
    }

    .hist-seo-section h3 {
        font-size: 4.2vw;
    }

    .hist-seo-section h4 {
        font-size: 3.8vw;
    }

    .hist-seo-section p {
        font-size: 3.4vw;
    }

    /* Bottom Tags */
    .hist-bottom-tags {
        gap: 2vw;
        padding: 4vw 0;
    }

    .hist-tag-item {
        padding: 2vw 4vw;
        font-size: 3vw;
    }

    /* Sidebar */
    .hist-sidebar {
        width: 100%;
        gap: 4vw;
    }

    .hist-sidebar-block {
        padding: 4vw;
        border-radius: 3vw;
    }

    .hist-sidebar-title {
        font-size: 4.5vw;
        margin-bottom: 4vw;
        padding-bottom: 3vw;
    }

    .hist-quote-price {
        font-size: 5vw;
    }

    .hist-quote-name {
        font-size: 3.5vw;
    }

    .hist-quote-code {
        font-size: 2.8vw;
    }

    .hist-quote-change {
        font-size: 3vw;
    }

    .hist-hot-tags {
        gap: 2vw;
    }

    .hist-hot-tag {
        padding: 1.5vw 3vw;
        font-size: 3vw;
    }

    .hist-hot-articles li a,
    .hist-price-list li a {
        font-size: 3.2vw;
        padding: 3vw 0;
        gap: 3vw;
    }

    .hist-article-num {
        width: 5vw;
        height: 5vw;
        min-width: 5vw;
        font-size: 2.8vw;
    }

    .hist-price-dot {
        width: 2vw;
        height: 2vw;
        min-width: 2vw;
        margin-top: 1.5vw;
    }
}