/* Basic Setup */
body {
    /* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; */
    /* font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; */
    font-family: 'Noto Sans KR', sans-serif;
    /* font-family: "Times New Roman", Times, serif; */
    line-height: 1.6;
    background-color: #fdfdfd;
    color: #333333;
    margin: 0;
    padding: 0;
}

main {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: #f0f0f0;
    padding: 20px 0;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

header h1 {
    margin: 0;
    color: #1a0dab;
}

header p {
    margin: 5px 0 0;
    font-style: italic;
    color: #555;
}

/* Page Content */
h2, h3 {
    color: #1a0dab;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 5px;
}

/* About Me Section */
.about-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.profile-pic {
    flex: 0 0 150px;
    width: 150px;
    height: 150px;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 50%;
    text-align: center;
    line-height: 150px;
    font-size: 0.8em;
    color: #777;
    overflow: hidden;
}

.bio {
    flex: 1;
}

/* --- PUBLICATION LIST STYLES --- */

/* Search Bar */
.search-container {
    margin-bottom: 20px;
}

#searchInput {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Pagination Container */
#paginationContainer {
    margin-top: 30px;
    text-align: center;
}

.page-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    color: #1a0dab;
    padding: 8px 14px;
    margin: 0 4px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.page-btn:hover {
    background-color: #e0e0e0;
}

.page-btn.active-page {
    background-color: #1a0dab;
    color: #ffffff;
    border-color: #1a0dab;
}

/* Publication Item Layout */
.publication-item {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ccc; /* Solid line */
}

.pub-image {
    flex: 0 0 160px;
    width: 160px;
}

.pub-image img {
    width: 100%;
    height: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.pub-details {
    flex: 1;
}

.pub-details p:first-child {
    margin-top: 0;
}

/* --- VIDEO GALLERY STYLES --- */

.video-gallery-horizontal {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.video-gallery-horizontal .video-item {
    flex: 1;
    min-width: 300px;
}

.video-item {
    width: 100%;
}

.video-caption {
    font-size: 0.9em;
    color: #555;
    margin-top: 10px;
    text-align: center;
}

.video-responsive-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background-color: #f0f0f0; /* Placeholder color */
}

.video-responsive-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- RESPONSIVE MOBILE STYLES --- */

@media (max-width: 600px) {
    /* Stack publication image on top of text */
    .publication-item {
        flex-direction: column;
    }

    .pub-image {
        width: 100%; 
        max-width: 300px;
        align-self: center;
    }
    
    /* Stack "About Me" image on top of bio */
    .about-container {
        flex-direction: column;
        align-items: center;
    }
}

/* --- MISC STYLES --- */

/* Email Image */
.email-image {
    vertical-align: middle;
    height: 1.2em; 
    margin-bottom: 3px;
}

/* Link Colors */
main a {
    color: #1a0dab;
    text-decoration: none;
}
main a:visited {
    color: #1a0dab; /* Keep visited links the same color */
}
main a:hover {
    text-decoration: underline;
}

/* --- NAVIGATION STYLES (Mobile-First & Responsive) --- */

/* Base <nav> container */
nav {
    background-color: #333;
    position: relative; /* Parent for mobile menu and desktop switcher */
    min-height: 60px; /* Give nav a consistent height */
    display: flex; 
    align-items: center;
    justify-content: flex-end; /* Aligns hamburger to the right on mobile */
}

/* --- HAMBURGER MENU (Mobile Default) --- */

#menu-toggle {
    display: block; /* Show hamburger by default */
    font-size: 28px;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001; /* Keep it above the menu */
    padding: 10px 20px; 
}

/* --- MENU CONTENT (Mobile Default: Hidden) --- */

#nav-content {
    display: none; 
    position: absolute; /* CHANGED from fixed */
    top: 60px;          /* CHANGED from 0 (60px is the min-height of your nav) */
    left: 0;
    width: 100%;
    height: auto;       /* CHANGED from 100vh */
    background-color: #333; /* CHANGED from transparent dark */
    z-index: 1000;
    flex-direction: column;
    justify-content: flex-start; /* CHANGED from center */
    align-items: center;
    
    /* ADD these two lines for spacing and a shadow */
    padding-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* This class is added by JS to the <nav> element */
nav.nav-open #nav-content {
    display: flex; /* Show the menu */
}

/* When menu is open, position the "X" button */
nav.nav-open #menu-toggle {
    /* position: fixed; */
    right: 20px;
    top: 10px; 
}

/* Mobile Menu List */
#nav-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column; /* Stack links vertically */
}

#nav-content ul li a {
    display: block;
    padding: 20px 0;
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    font-size: 1.5em;
}

/* Mobile Language Switcher */
#nav-content .lang-switcher {
    position: static; 
    transform: none;
    margin-top: 30px;
    color: #fff;
    display: flex;
    gap: 8px;
}

#nav-content .lang-switcher a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 0 5px;
    font-size: 1.2em;
}

/* --- FLAG ICON STYLES --- */
.flag-icon {
    width: 30px; 
    height: auto;
    border-radius: 3px;
    border: 1px solid #ccc;
    vertical-align: middle;
    transition: all 0.2s ease-in-out;
}

.lang-link {
    opacity: 0.7;
    display: inline-block;
}

.lang-link.active-lang {
    opacity: 1.0;
    transform: scale(1.1);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
}

.lang-link:not(.active-lang):hover {
    opacity: 1.0;
}

/* --- DESKTOP STYLES (768px and wider) --- */

@media (min-width: 768px) {

    nav {
        justify-content: center; /* Center menu on desktop */
    }

    #menu-toggle {
        display: none; /* Hide hamburger */
    }

    #nav-content {
        display: flex;
        flex-direction: row; /* Horizontal layout */
        position: static;
        height: auto;
        width: auto;
        background-color: transparent;
    }
    
    #nav-content ul {
        flex-direction: row; /* Horizontal links */
    }

    #nav-content ul li a {
        padding: 15px 20px;
        font-size: 1em;
    }
    
    #nav-content ul li a:hover {
        background-color: #555;
    }

    #nav-content ul li a.active {
        background-color: #1a0dab;
    }
    
    #nav-content ul li a:visited {
        color: #fff;
    }

    /* Restore desktop language switcher */
    #nav-content .lang-switcher {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        margin-top: 0;
    }
    .pub-item { 
    display: flex; 
    flex-direction: row; 
    padding: 25px 0; 
    border-bottom: 1px solid #ddd; 
    align-items: flex-start;
    transition: background 0.3s;
}
.pub-item:hover { background-color: #f2f2f2; }

/* --- Buttons (PDF/Link) --- */
.pub-btns { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    min-width: 100px; 
    margin-left: auto; 
    /* text-align: right;  */
}

.btn { 
    display: inline-block; 
    padding: 6px 12px; 
    font-size: 12px; 
    border: 1px solid transparent;
    border-radius: 3px; 
    background: #fff; 
    color: #555; 
    /* transition: all 0.2s; */
    text-align: center;
}
.btn:hover { background: #ca2270; color: #fff; border-color: #ca2270; border: 1px solid #ca2270;}
.btn i { margin-right: 5px; }
}
.pub-item {
    position: relative;
    z-index: 10;
}
/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #eee;
    font-size: 0.9em;
    color: #777;
}

/* Mobile Language Switcher */
#nav-content .lang-switcher {
    position: static; 
    transform: none;
    margin-top: 30px;
    color: #fff;
    display: flex;
    gap: 8px;
}

#nav-content .lang-switcher a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 0 5px;
    font-size: 1.2em;
}


.no-bullet {
    list-style-type: none;
    padding-left: 0; /* Remove default padding for a cleaner look */
}


::selection {
  background-color: orange;
  color: black; /* Optional: Changes the text color for better contrast */
}

/* This is for older Firefox browsers */
::-moz-selection {
  background-color: orange;
  color: black;
}

/* 
.status-block {
    display: inline-block;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    
    font-weight: normal;
} margin-left: 10px;*/
.status-published { background: #e3f2fd; color: #1565c0; }
.status-submitted { background: #fff3e0; color: #e65100; }
.status-poster { background: #d2ffe2; color: #188b29; }
.keyword { background: #dfdfdf; color: #696360; }



/* --------------------------------------- */


.shield-row { display: flex; gap: 10px; flex-wrap: wrap;}

.shield {
  display: inline-flex;
  align-items: stretch;
  border-radius: 4px;
  overflow: hidden; /* Ensures child elements don't spill out */
  font-size: 10px;
  /* font-family: monospace;  Optional: gives a tech vibe */
  border: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.shield-label {
  font-size: 10px;
  background: #f0f0f0; /* Dark background for label */
  color: black;
  padding: 4px 8px;
  /* font-weight: bold; */
}

.shield-count {
  padding: 4px 8px;
  font-size: 20px;
  font-weight: bold;
  background: #fff; /* Default background */
}
.shield-count2 {
  padding: 4px 8px;
  font-size: 20px;
  font-weight: bold;
  background: #fff; /* Default background */
}
/* Specific Colors targeting the COUNT side */
.shield-submitted .shield-count { background: #fff3e0; color: #e65100; }
.shield-published .shield-count { background: #e3f2fd; color: #1565c0; }
.shield-poster .shield-count { background: #d2ffe2; color: #188b29; }
.shield-keyword .shield-count { background: #dfdfdf; color: #696360; }


/* --------------------------------------- */

.counter-container {
  display: flex;
  gap: 15px;
  /* overflow-x: auto;  */
  /* padding-bottom: 10px; */
  flex-wrap: wrap;
}

.counter-box {
  display: flex;
  flex-direction: column; /* Stacks number on top of text */
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  min-width: 80px;
  flex-shrink: 0;
}

.counter-box .count {
  /* font-size: 24px; */
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 4px;
}

.counter-box .label {
  /* font-size: 11px; */
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* --------------------------------------- */
/* Container to align them horizontally */
.stats-row {
  display: flex;
  gap: 8px; /* Space between blocks */
  align-items: center;
  flex-wrap: wrap;
}

/* Your existing base class with slight tweaks */
.status-block {
  display: inline-flex; /* Better for aligning icon/text inside */
  align-items: center;
  gap: 5px;
  font-size: 13px; /* Slightly larger for readability */
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
  border: 1px solid transparent; /* Optional: adds definition */
}

/* Strong tag styling to make the number pop */
.status-block strong {
  font-weight: 800;
  opacity: 0.9;
}

.shield-total .shield-count {
  background: #f3e5f5; /* Light Lavender */
  color: #7b1fa2;      /* Deep Purple */
}
.shield-total {
    box-shadow: 0 4px 6px rgba(0,0,0,0.15); /* Lift effect */
    border: 1px solid rgba(0,0,0,0.2);     /* Slightly darker border */
    transform: scale(1.02);                /* Make it 2% bigger than others */
}
.shield-total .shield-count2 {
  background: #e4faff; /* Light Lavender */
  color: #847dff;      /* Deep Purple */
}
/* 1. Basic Box Styling */
.compact-box {
    font-size: 9pt;
    border: 1px solid #ccc;
    border-radius: 1px; /* Smaller radius for smaller box */
    padding: 4px 8px;
    
    /* This makes the box shrink to fit the text width */
    width: -moz-fit-content;
    width: fit-content; 
    
    background: #f9f9f9;
    margin-bottom: 10px;
  }

  /* 2. Style the Clickable Header (Summary) */
  summary {
    cursor: pointer;
    padding: 12px 16px;
    background-color: #f9f9f9;
    font-weight: bold;
    display: flex; /* Flex helps align the arrow */
    align-items: center;
    justify-content: space-between; /* Pushes arrow to the right */
    list-style: none; /* Hides default ugly browser triangle */
  }

  /* Hide default marker in Safari/Chrome */
  summary::-webkit-details-marker {
    display: none;
  }

  /* 3. Create the Arrow */
  summary::after {
    content: ' +'; /* You can use '>', '+', or an icon */
    font-size: 14px;
    transition: transform 1.0s ease; /* Smooth rotation */
  }

  /* 4. Rotate Arrow when Open */
  details[open] summary::after {
    transform: rotate(45deg);
  }

  /* 5. The Hidden Content Area */
  .content {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #eee;
  }