/* =========================================
   이지툴즈 통합 스타일시트 (가독성 최종 강화 Ver)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;800&family=Pretendard:wght@400;500;700&display=swap');

/* 1. 색상 변수 정의 */
:root {
    --primary: #4F46E5;
    --bg: #F3F4F6;
    --sidebar-bg: #ffffff;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #1F2937;
    --text-sub: #6B7280;
    --border: #E5E7EB;
    --input-bg: #F9FAFB;
    --input-border: #D1D5DB;
    --hover-bg: #EEF2FF;
    --shadow: rgba(0, 0, 0, 0.05);
    --sidebar-width: 260px;
    --header-height: 60px;
}

[data-theme="dark"] {
    --primary: #818CF8;
    --bg: #111827;
    --sidebar-bg: #1F2937;
    --header-bg: #1F2937;
    --card-bg: #1F2937;
    --text-main: #F9FAFB;
    --text-sub: #9CA3AF;
    --border: #374151;
    --input-bg: #374151;
    --input-border: #4B5563;
    --hover-bg: #374151;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* 2. 기본 레이아웃 */
body {
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* 3. 사이드바 스타일 */
.sidebar { width: var(--sidebar-width); background-color: var(--sidebar-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; transition: transform 0.3s ease; z-index: 1000; }
.logo-area { height: var(--header-height); display: flex; align-items: center; padding: 0 1.5rem; border-bottom: 1px solid var(--border); font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.logo-area i { margin-right: 10px; }
.menu-list { flex: 1; overflow-y: auto; padding: 1.5rem 1rem; }
.menu-category { font-size: 0.75rem; text-transform: uppercase; color: var(--text-sub); font-weight: 700; margin-bottom: 0.5rem; margin-top: 1.5rem; padding-left: 0.75rem; }
.menu-category:first-child { margin-top: 0; }
.menu-item { display: flex; align-items: center; padding: 0.75rem; border-radius: 8px; color: var(--text-sub); text-decoration: none; font-size: 0.95rem; transition: all 0.2s; cursor: pointer; }
.menu-item:hover, .menu-item.active { background-color: var(--hover-bg); color: var(--primary); font-weight: 500; }
.menu-item i { width: 24px; text-align: center; margin-right: 10px; font-size: 1.1rem; }
.sidebar-footer { padding: 1.5rem; font-size: 0.8rem; color: var(--text-sub); text-align: center; border-top: 1px solid var(--border); line-height: 1.6; }
.sidebar-footer a { color: var(--text-sub); text-decoration: none; }

/* 4. 메인 컨텐츠 영역 */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.top-header { height: var(--header-height); background-color: var(--header-bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 1.5rem; justify-content: space-between; }
.header-left { display: flex; align-items: center; gap: 15px; flex: 1; }
.mobile-menu-btn { display: none; font-size: 1.5rem; background: none; border: none; cursor: pointer; color: var(--text-main); }
.search-container { position: relative; max-width: 400px; width: 100%; }
.search-container input { width: 100%; padding: 10px 15px 10px 40px; border-radius: 8px; border: 1px solid var(--border); background-color: var(--input-bg); color: var(--text-main); outline: none; }
.search-container i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-sub); }
.theme-btn { background: none; border: 1px solid var(--border); color: var(--text-main); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-left: 15px; }
.theme-btn:hover { background-color: var(--hover-bg); color: var(--primary); }

.content-scroll { flex: 1; overflow-y: auto; padding: 2rem; }

/* ▼▼▼ [수정됨] 웰컴 배너 가독성 최종 강화 ▼▼▼ */
.welcome-banner { 
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%); 
    border-radius: 16px; 
    padding: 2.5rem; 
    color: white; 
    margin-bottom: 2.5rem; 
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3); 
    position: relative;
    overflow: hidden;
}
.welcome-banner h2 { 
    margin: 0 0 10px 0; 
    font-size: 2.4rem;   /* 글자 크기 더 키움 */
    font-weight: 800;    /* 폰트 가장 두껍게 */
    color: #ffffff;      /* 선명한 흰색 */
    text-shadow: 2px 2px 5px rgba(0,0,0,0.5); /* 진한 그림자 추가 */
    letter-spacing: -1px;
}
.welcome-banner p { 
    margin: 0; 
    font-size: 1.1rem;   /* 글자 크기 약간 키움 */
    color: #f0f0f0;      /* 약간 밝은 흰색 */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4); /* 그림자 추가 */
    opacity: 1;          /* 불투명하게 */
}
/* ▲▲▲ 여기까지 수정됨 ▲▲▲ */

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.tool-card { background: var(--card-bg); border-radius: 12px; padding: 1.5rem; border: 1px solid var(--border); text-decoration: none; color: inherit; transition: all 0.2s; display: flex; flex-direction: column; position: relative; }
.tool-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px var(--shadow); border-color: var(--primary); }
.tool-icon { width: 48px; height: 48px; border-radius: 10px; background-color: var(--hover-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; }
.new-badge { position: absolute; top: 15px; right: 15px; background-color: #EF4444; color: white; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; font-weight: bold; }

/* 5. 깔끔한 푸터 스타일 */
.main-footer { margin-top: 60px; padding: 40px 0; text-align: center; border-top: 1px solid var(--border); color: var(--text-sub); font-size: 0.9rem; }
.donation-simple { margin-bottom: 15px; font-size: 0.95rem; color: var(--text-main); background-color: var(--hover-bg); display: inline-block; padding: 8px 16px; border-radius: 20px; font-weight: 500; }
.donation-simple strong { color: var(--primary); }
.footer-info a { color: inherit; text-decoration: underline; }

/* 6. 모바일 반응형 */
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -100%; height: 100%; box-shadow: 5px 0 15px rgba(0,0,0,0.5); }
    .sidebar.open { left: 0; }
    .mobile-menu-btn { display: block; }
    .content-scroll { padding: 1.5rem; }
}
.overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 999; }
.overlay.active { display: block; }

/* 7. 도구 페이지 스타일 */
body.tool-page { display: block; padding: 20px; overflow-y: auto; height: auto; }
.container { background: var(--card-bg); padding: 2rem; border-radius: 16px; width: 100%; max-width: 600px; margin: 0 auto 50px auto; text-align: center; border: 1px solid var(--border); position: relative; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }

h1 { color: var(--primary); margin-bottom: 1.5rem; font-weight: 800; font-size: 1.8rem; }
h2 { color: var(--primary); margin-bottom: 1rem; font-size: 1.4rem; }
label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-main); font-size: 0.95rem; text-align: left; }

input, select, textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--input-border); border-radius: 10px; font-size: 1rem; background-color: var(--input-bg); color: var(--text-main); margin-bottom: 15px; box-sizing: border-box; transition: all 0.2s ease; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); background-color: var(--card-bg); }
::placeholder { color: var(--text-sub); opacity: 0.6; }

.calc-btn { width: 100%; background-color: var(--primary); color: white; padding: 16px; border: none; border-radius: 10px; font-size: 1.1rem; font-weight: bold; cursor: pointer; margin-top: 10px; transition: 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.calc-btn:hover { filter: brightness(110%); transform: translateY(-2px); }

.result-box { background-color: var(--bg); padding: 1.5rem; border-radius: 12px; margin-top: 2rem; border: 1px solid var(--border); display: none; }
.back-btn { display: inline-block; margin-top: 30px; text-decoration: none; color: var(--text-sub); font-size: 0.9rem; padding: 10px 20px; border-radius: 50px; background: var(--bg); transition: 0.2s; }
.back-btn:hover { background: var(--hover-bg); color: var(--primary); }
.tool-theme-btn { position: absolute; top: 20px; right: 20px; background: var(--bg); border: 1px solid var(--border); color: var(--text-main); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.tool-theme-btn:hover { color: var(--primary); border-color: var(--primary); }

.info-section { margin-top: 50px; border-top: 1px dashed var(--border); padding-top: 30px; text-align: left; color: var(--text-sub); line-height: 1.7; }
.info-section h2 { border-bottom: 2px solid var(--border); padding-bottom: 10px; display: inline-block; }
.info-section h3 { color: var(--text-main); margin-top: 25px; }

/* 8. 토스트 알림 */
#toast-container { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast-message { background-color: rgba(31, 41, 55, 0.95); color: #fff; padding: 12px 24px; border-radius: 50px; font-size: 0.95rem; box-shadow: 0 4px 15px rgba(0,0,0,0.3); opacity: 0; transform: translateY(20px); transition: all 0.3s ease; display: flex; align-items: center; gap: 10px; font-weight: 500; min-width: 200px; justify-content: center; }
.toast-message.show { opacity: 1; transform: translateY(0); }
.toast-message i { color: #4ADE80; }