/* GOOGLE FONTS */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap");

/* VARIABLES CSS */
:root {
    --nav--width: 92px;

    /* Colors */
    --first-color: #0c5df4;
    --bg-color: #12192c;
    --sub-color: #b6cefc;
    --white-color: #fff;

    /* Font and typography */
    --body-font: 'Poppins', sans-serif;
    --normal-font-size: 1rem;
    --small-font-size: .875rem;

    /* z-index */
    --z-fixed: 100;
}

/* BASE */
*, ::before, ::after {
    box-sizing: border-box;
}

body {
    position: relative;
    margin: 0;
    padding: 2rem 0 0 6.75rem;
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
    transition: .5s;
}

h1 {
    margin: 0;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    text-decoration: none;
}

/* Sidebar Navigation */
.l-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--nav--width);
    height: 100vh;
    background-color: var(--bg-color);
    color: var(--white-color);
    padding: 1.5rem 1.5rem 2rem;
    transition: .5s;
    z-index: var(--z-fixed);
}

/* NAV */
.nav {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.nav__brand {  
    display: flex;
    align-items: center;
    justify-content: flex-start; 
    margin-left: 1rem; /* adjust if necessary */
    z-index: 999;      /* bring above the image */
}

.nav__toggle {
    width: 24px;
    height: 24px;
    object-fit: contain;
    /* margin: 0 auto; */ 
    margin-bottom: 1rem; /* adjust if necessary */
}

.nav__logo {
    color: var(--white-color);
    font-weight: 600;
}

.nav__link {
    display: grid;
    grid-template-columns: max-content max-content;
    align-items: center;
    column-gap: .75rem;
    padding: .75rem;
    color: var(--white-color);
    border-radius: .5rem;
    margin-bottom: 1rem;
    transition: .3s;
    cursor: pointer;
}

.nav__link:hover {
    background-color: var(--first-color);
} 

.nav_name {
    font-size: var(--small-font-size);
}

/* Expander menu */
.expander {
    width: calc(var(--nav--width) + 9.25rem);
}

/* Add padding to body */
.body-pd {
    padding: 2rem 0 0 16rem;
}

/* Active links in menu */
.active {
    background-color: var(--first-color);
}

/* COLLAPSE */
.collapse {
    grid-template-columns: 20px max-content 1fr;
}

.collapse__link {
    justify-self: flex-end;
    transition: .5;
}

.collapse__menu {
    display: none;
    padding: .75rem 2.25rem;
}

.collapse__sublink {
    color: var(--sub-color);
    font-size: var(--small-font-size);
}

.collapse__sublink:hover {
    color: var(--white-color);
}

/* Show collapse */
.showCollapse {
    display: block;
}

/* Rotate icon */
.rotate {
    transform: rotate(180deg);
    transition: .5s;
}

/* Tooltip styles */
.nav-tooltip {
    position: fixed;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    pointer-events: none; /* prevent tooltip from interfering with mouse events */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    white-space: nowrap;
    transition: top 0.1s ease; /* only smooth vertical movement */
}
  
/* Tooltip arrow */
.nav-tooltip:before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 6px 6px 0;
    border-style: solid;
    border-color: transparent #333 transparent transparent;
}
  
/* When the sidebar is expanded, nav_name is visible so tooltip is not needed */
.expander .nav-tooltip {
    display: none;
}

/* Content area styles */
#content-area {
    padding: 20px;
    margin-left: 68px; /* match the default sidebar width */
    transition: margin-left 0.5s; /* move smoothly along with the sidebar */
}

/* Adjust content area when sidebar is expanded */
body.body-pd #content-area {
    margin-left: 200px; /* adjusted for expanded sidebar width */
}

/* Loading indicator styles */
.loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
}

/* Error message styles */
.error-message {
    padding: 20px;
    background-color: #fff3f3;
    border-left: 4px solid #f44336;
    margin-bottom: 20px;
}

.error-message h2 {
    color: #f44336;
    margin-top: 0;
}

.copy-text {
    cursor: pointer;
    color: blue;
    text-decoration: underline;
  }

  .copied {
    color: green;
  }

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    :root {
       --nav--width: 58px; /* increase sidebar width so that icons are fully visible */
    }
    
    .l-navbar {
       width: var(--nav--width);
       padding: 0.5rem; /* reduce padding for inner content space */
    }
    
    #content-area {
       margin-left: calc(var(--nav--width) + 10px);
       padding: 10px;
    }
     
    img, video {
        max-width: 100%;
        height: auto;
    }  
    
    html {
        font-size: 87.5%; /* 모바일에서 전체적으로 14px 기준 */
    }
}