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

:root {
  /* Blue Ocean Gradient Palette */
  --hr-deep-blue: #023e8a;
  --hr-ocean-blue: #0077b6;
  --hr-sky-blue: #00b4d8;
  --hr-light-blue: #90e0ef;
  
  --hr-glass-bg: rgba(255, 255, 255, 0.85);
  --hr-glass-border: 1px solid rgba(255, 255, 255, 0.9);
  
  --hr-text-primary: #0b2545;
  --hr-text-secondary: #486a8b;
  --hr-bg-body: #f0f7fa;
  
  --shadow-premium: 0 20px 50px rgba(0, 75, 125, 0.15);
  --shadow-sharp: 0 10px 0px rgba(0, 0, 0, 0.1); 
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --hr-glass-bg: rgba(15, 23, 42, 0.9);
  --hr-glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --hr-text-primary: #e2e8f0;
  --hr-text-secondary: #94a3b8;
  --hr-bg-body: #0f172a;
  --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.5);
  --shadow-sharp: 0 5px 0px rgba(0, 0, 0, 0.3);
}

body {
  font-family: 'Kanit', sans-serif !important;
  background-color: var(--hr-bg-body);
  background-image: 
    radial-gradient(at 0% 0%, hsla(203, 89%, 41%, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, hsla(190, 100%, 42%, 0.1) 0px, transparent 50%);
  color: var(--hr-text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Header Banner Section (STRAIGHT EDGE) --- */
.hr-header-banner {
    position: relative;
    padding-top: 150px; /* เพิ่มพื้นที่ด้านบนเล็กน้อย */
    padding-bottom: 6rem; /* เพิ่มพื้นที่ด้านล่างเพื่อให้กล่อง Content ซ้อนทับสวยๆ */
    margin-bottom: 4rem; /* ดึงกล่อง Content ขึ้นมาซ้อนทับ Banner */
    color: #fff;
    
    /* 1. Base Gradient: Blue Ocean Deep to Light */
    background: linear-gradient(135deg, #001233 0%, #003049 30%, #006494 70%, #0096c7 100%);
    
    /* เอา clip-path ออกเพื่อให้เป็นเส้นตรง */
    clip-path: none; 
    
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    overflow: hidden;
    z-index: 1;
}

/* 2. Geometric Lines Pattern (Overlay) */
.hr-header-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    
    background-image: 
        /* เส้นเฉียงบางๆ */
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.03) 0px,
            rgba(255, 255, 255, 0.03) 1px,
            transparent 1px,
            transparent 20px
        ),
        /* เส้นตัดขนาดใหญ่ */
        linear-gradient(
            120deg,
            transparent 40%,
            rgba(255, 255, 255, 0.05) 40%,
            rgba(255, 255, 255, 0.05) 60%,
            transparent 60%
        ),
        /* แสงไฮไลท์มุมขวาบน */
        radial-gradient(
            circle at 90% 10%, 
            rgba(255, 255, 255, 0.15) 0%, 
            transparent 40%
        );
        
    z-index: -1; 
    pointer-events: none;
}

/* 3. Depth Glow */
.hr-header-banner::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 60%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.2) 0%, transparent 70%);
    filter: blur(40px);
    z-index: -1;
    pointer-events: none;
}

.hr-main-title {
    font-weight: 700;
    font-size: 3rem;
    text-shadow: 0 4px 15px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.hr-sub-title {
    font-weight: 300;
    font-size: 1.6rem;
    opacity: 0.95;
    letter-spacing: 3px;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
    background: linear-gradient(to right, #90e0ef, #ffffff, #90e0ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hr-title-divider {
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #48cae4, transparent);
    margin-top: 1.5rem;
    border-radius: 2px;
    position: relative;
    z-index: 2;
}

/* --- Main Content Box --- */
.hr-page-container {
    padding-bottom: 4rem;
}

.hr-content-box {
    background: var(--hr-glass-bg);
    border: var(--hr-glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 8px; /* ปรับมุมให้มนน้อยลงเพื่อให้เข้ากับความ Sharp ของ Header */
    padding: 3rem;
    box-shadow: var(--shadow-premium);
    position: relative;
    margin-top: 0;
}

/* --- Info Card Section --- */
.hr-info-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-left: 5px solid var(--hr-ocean-blue);
    padding: 1.5rem;
    border-radius: 4px; /* ปรับให้ดูเหลี่ยมขึ้นเล็กน้อย */
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

[data-theme="dark"] .hr-info-card {
    background: rgba(255, 255, 255, 0.05);
}

.hr-info-card:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.8);
}
[data-theme="dark"] .hr-info-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hr-info-card .icon-box {
    font-size: 2rem;
    color: var(--hr-ocean-blue);
    background: rgba(0, 180, 216, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.section-heading {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--hr-deep-blue);
    margin-bottom: 0.5rem;
}
[data-theme="dark"] .section-heading {
    color: var(--hr-light-blue);
}

.hr-info-card p {
    color: var(--hr-text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* --- Image Container & Zoom --- */
.hr-image-container {
    text-align: center;
}

.hr-zoom-wrapper {
    position: relative;
    display: inline-block;
    cursor: zoom-in;
    border-radius: 8px; /* ปรับให้เข้ากับ Theme */
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    border: 8px solid #fff;
    max-width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .hr-zoom-wrapper {
    border-color: #2a2a2a;
}

.hr-zoom-wrapper:hover {
    transform: scale(1.01);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.hr-chart-image {
    display: block;
    width: 100%;
    height: auto;
}

.hr-zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 62, 138, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.hr-zoom-wrapper:hover .hr-zoom-overlay {
    opacity: 1;
}

.hr-zoom-icon {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.6);
    padding: 12px 25px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.hr-zoom-wrapper:hover .hr-zoom-icon {
    transform: translateY(0);
}

/* --- Download Button --- */
.hr-download-section {
    display: flex;
    justify-content: center;
}

.hr-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #023e8a 0%, #0096c7 100%);
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px; 
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 10px 20px rgba(2, 62, 138, 0.3);
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.hr-download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(2, 62, 138, 0.4);
}

.hr-download-btn .btn-icon {
    font-size: 1.2rem;
}

/* --- Modal Styles --- */
.bg-dark-modal {
    background-color: #0f172a;
}

.btn-close-custom {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1090;
    transition: background 0.3s;
}

.btn-close-custom:hover {
    background: rgba(255, 255, 255, 0.3);
}

#zoomImage {
    transition: transform 0.1s ease-out;
    cursor: grab;
    transform-origin: center center;
}

#zoomImage:active {
    cursor: grabbing;
}

.hr-zoom-controls {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1080;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    gap: 15px;
    align-items: center;
    backdrop-filter: blur(10px);
}

.btn-ctrl {
    background: transparent;
    border: 1px solid #ccc;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    transition: all 0.2s;
}

.btn-ctrl:hover {
    background: var(--hr-ocean-blue);
    color: #fff;
    border-color: var(--hr-ocean-blue);
}

.btn-ctrl-reset {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-ctrl-reset:hover {
    background: #bb2d3b;
}

.ctrl-divider {
    width: 1px;
    height: 25px;
    background: #ccc;
}

#zoomLevelText {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #333;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .hr-header-banner {
        padding-top: 100px;
        clip-path: none; /* Make sure mobile is also straight */
    }
    .hr-main-title {
        font-size: 1.8rem;
    }
    .hr-sub-title {
        font-size: 1.1rem;
    }
    .hr-content-box {
        padding: 1.5rem;
    }
    .hr-download-btn {
        width: 100%;
        justify-content: center;
    }
}