/* 기본 변수 */
:root {
    --sidebar-width: 250px;
    --header-height: 60px;
    --primary: #38b6ff;
    --primary-color: #38b6ff;
    --primary-dark: #2c91cc;
    --primary-light: #e6f4ff;
    --secondary: #6c757d;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --dark: #2d3748;
    --light: #f8f9fa;
    --white: #ffffff;
    --text-color: #4b5564;
    --transition-speed: 0.3s;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
    --border-radius: 16px;
    --card-padding: 1.5rem;
}

/* 기본 레이아웃 */
html {
    position: relative;
    min-height: 100%;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    background-color: #f8fafc;
    color: var(--dark);
    line-height: 1.6;
}

/* 사이드바 기본 스타일 */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    width: var(--sidebar-width);
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    background: var(--primary-color);
    /* 스크롤 처리 추가 */
    overflow-y: auto;
    overflow-x: hidden;
}

/* 사이드바 내용을 감싸는 컨테이너 */
.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 사이드바 로고 영역 */
.sidebar-logo {
    text-align: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* 로고 영역 고정 */
    flex-shrink: 0;
}

.sidebar-logo img {
    max-width: 70%;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.sidebar-logo img:hover {
    transform: scale(1.05);
}

/* 공통 네비게이션 링크 스타일 */
.sidebar .nav-link {
    color: white;
    font-weight: 500;
    font-size: 1rem;
    transition: all var(--transition-speed);
    border-right: 20px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin: 0.2rem 0.5rem;
}

.sidebar .nav-link i, 
.sidebar .nav-link .bi {
    width: 24px;
    margin-right: 0.8rem;
    text-align: center;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-weight: 600;
}

/* 스크롤바 스타일링 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 사용자 정보 영역 */
.user-info {
    margin: 1rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.user-info .user-name {
    background-color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0.8rem;
    padding: 0.8rem 1rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.2;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.user-info .company-logo {
    max-width: 150px;
    max-height: 80px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    display: block;
    margin: 0 auto 0.8rem;
    background-color: rgba(255, 255, 255, 0.3);
    padding: 0.5rem;
}

.user-info .login-link {
    display: block;
    width: 100%;
    padding: 0.6rem 0;
    color: #ffffff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.user-info .login-link:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #2193b0;
    transform: translateY(-2px);
}

.user-info .user-link {
    color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1.3rem;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed);
}

.user-info .user-link:hover {
    filter: brightness(0.8);
    transform: translateY(-2px);
}

/* 메인 콘텐츠 영역 */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    flex: 1;
    min-height: 100vh;
    transition: margin-left var(--transition-speed);
}

/* 로그인 페이지 등 사이드바가 없는 경우 */
.main-content.no-sidebar {
    margin-left: 0;
    padding: 0;
}

/* 푸터 스타일 */
.footer {
    background-color: white;
    padding: 3rem 2rem;
    margin-left: var(--sidebar-width);
    color: var(--text-color);
    transition: margin-left var(--transition-speed);
}

/* 로그인 페이지 등 사이드바가 없는 경우 푸터 숨김 */
.footer.no-sidebar {
    display: none;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer__navi-heading {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.footer__navi {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer__navi h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.footer__navi h5 {
    margin: 0.8rem 0 0.3rem 0;
    font-size: 0.9rem;
    color: #2d3748;
}

.footer__navi a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-speed);
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer__navi a:hover {
    color: var(--primary-color);
}

.copyright {
    margin-top: 2rem;
    text-align: center;
    color: #718096;
}

/* 모바일 헤더 스타일 */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    height: var(--header-height);
    padding: 0 20px;
    z-index: 1031;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-header-content {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: white;
    padding: 10px;
    font-size: 1.25rem;
    cursor: pointer;
}

/* 사이드바 오버레이 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* 알림 스타일 */
.alert {
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .mobile-header {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content,
    .footer {
        margin-left: 0;
    }
    
    .main-content {
        padding-top: calc(var(--header-height) + 1rem);
    }
    
    .grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
}

/* 작은 화면에서 사이드바 최소 높이 보장 */
@media (max-height: 600px) {
    .sidebar {
        padding: 1rem;
    }
    
    .sidebar-logo {
        padding: 1rem 0.5rem;
    }
    
    .sidebar .nav-link {
        padding: 0.4rem 0.8rem;
        margin: 0.1rem 0.3rem;
        font-size: 0.75rem;
    }
    
    .user-info {
        margin: 0.5rem;
        padding: 0.8rem;
    }
}

/* 노트북 화면 (작은 해상도) */
@media (max-height: 800px) and (max-width: 1366px) {
    .sidebar {
        padding: 1rem;
    }
    
    .sidebar-logo {
        padding: 1rem 0.5rem;
    }
    
    .sidebar .nav-link {
        padding: 0.4rem 0.8rem;
        margin: 0.1rem 0.3rem;
        font-size: 0.85rem;
    }
    
    .user-info {
        margin: 0.5rem;
        padding: 0.8rem;
    }
    
    .user-info .user-name {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }
    
    .user-info .company-logo {
        max-width: 120px;
        max-height: 60px;
    }
}

/* 중간 크기 화면 (Full HD) */
@media (min-height: 800px) and (max-height: 1079px) and (min-width: 1367px) and (max-width: 1919px) {
    .sidebar {
        padding: 1.5rem;
    }
    
    .sidebar-logo {
        padding: 1.5rem 1rem;
    }
    
    .sidebar .nav-link {
        padding: 0.6rem 1.2rem;
        margin: 0.25rem 0.6rem;
        font-size: 0.95rem;
    }
    
    .user-info {
        margin: 1.2rem;
        padding: 1.2rem;
    }
}

/* 매우 작은 화면에서 사이드바 너비 조정 */
@media (max-width: 768px) {
    .sidebar {
        width: calc(var(--sidebar-width) - 20px);
    }
}

/* 입력 필드 너비 클래스 - 반복 코드 줄임 */
[class*="input-"] {
    width: var(--width);
}

.input-10p {
    --width: 10%;
}
.input-20p {
    --width: 20%;
}
.input-30p {
    --width: 30%;
}
.input-35p {
    --width: 35%;
}
.input-40p {
    --width: 40%;
}
.input-45p {
    --width: 45%;
}
.input-55p {
    --width: 55%;
}
.input-65p {
    --width: 65%;
}
.input-75p {
    --width: 75%;
}
.input-85p {
    --width: 85%;
}
.input-95p {
    --width: 95%;
}
.input-50p {
    --width: 50%;
}
.input-60p {
    --width: 60%;
}
.input-70p {
    --width: 70%;
}
.input-80p {
    --width: 80%;
}
.input-90p {
    --width: 90%;
}
.input-100p {
    --width: 100%;
}

