/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* 로그인 페이지 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 300px;
}

.login-form input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.login-form button {
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-form button:hover {
    background: #5a67d8;
}

/* 메인 레이아웃 */
.container {
    display: flex;
    min-height: 100vh;
}

/* 사이드바 */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    transition: width 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #34495e;
}

.sidebar.collapsed .sidebar-header h2 {
    display: none;
}

.toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.sidebar-menu {
    flex: 1;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #34495e;
}

.sidebar.collapsed .sidebar-menu a {
    text-align: center;
}

.user-info {
    padding: 20px;
    border-top: 1px solid #34495e;
}

.user-info button {
    margin-top: 10px;
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

/* 메인 콘텐츠 */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-x: hidden;
    max-width: 100%;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* 버튼 스타일 */
.btn-primary {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #2980b9;
}

/* 대시보드 */
.dashboard-section {
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.3em;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.summary-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.summary-item .title {
    font-weight: 500;
    margin-bottom: 5px;
}

.summary-item .meta {
    font-size: 12px;
    color: #666;
}

/* 오늘의 스케줄 */
.today-schedule {
    margin-top: 15px;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btn-small {
    padding: 5px 15px;
    font-size: 14px;
}

.schedule-week-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 0;
    margin: 0 auto;
}

.day-item {
    flex: 1;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 120px;
}

.day-item.today {
    background: #3498db;
    color: white;
}

.day-item.yesterday {
    background: #fff3cd;
    border-color: #ffc107;
}

.day-label {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #2196f3;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: normal;
}

.day-item.yesterday .day-label {
    background: #ffc107;
}

.day-name {
    font-size: 14px;
    margin-bottom: 5px;
}

.day-date {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.day-schedules {
    font-size: 12px;
    text-align: left;
}

/* 게시판 스타일 */
.board-list {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.board-item {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background 0.3s;
}

.board-item:hover {
    background: #f8f9fa;
}

.board-item .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.board-item .title {
    font-size: 18px;
    font-weight: 500;
}

.board-item .meta {
    font-size: 14px;
    color: #666;
}

.issue-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 10px;
}

.issue-status.resolved {
    background: #2ecc71;
    color: white;
}

.issue-status.pending {
    background: #e74c3c;
    color: white;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover {
    background: #3498db;
    color: white;
}

.pagination button.active {
    background: #3498db;
    color: white;
}

/* 캘린더 */
.calendar {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #ddd;
    border: 1px solid #ddd;
}

.calendar-day {
    background: white;
    padding: 10px;
    min-height: 100px;
    position: relative;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.calendar-day.other-month {
    background: #f8f9fa;
    opacity: 0.6;
}

.calendar-day.today {
    background: #e3f2fd;
}

.calendar-day.today .day-number {
    background: #2196f3;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.calendar-day-header {
    font-weight: bold;
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
}

.day-number {
    font-weight: bold;
    margin-bottom: 5px;
}

.day-schedules {
    margin-top: 5px;
}

.schedule-item {
    font-size: 12px;
    padding: 3px 5px;
    margin: 2px 0;
    background: #e8f5e9;
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-item:hover {
    background: #c8e6c9;
}

/* 메모 */
.memo-container {
    display: flex;
    gap: 20px;
    height: 600px;
}

.memo-list {
    width: 300px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.memo-item {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background 0.3s;
}

.memo-item:hover,
.memo-item.active {
    background: #f8f9fa;
}

.memo-content {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.memo-content h2 {
    margin-bottom: 20px;
}

.memo-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.memo-body {
    line-height: 1.8;
    font-size: 16px;
}

.memo-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
}

.post-meta {
    margin: 20px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 14px;
    color: #666;
}

.post-content {
    margin: 20px 0;
    line-height: 1.8;
    font-size: 16px;
}

.post-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

.btn-danger {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-danger:hover {
    background: #c0392b;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* 상세 페이지 */
.detail-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: calc(100vh - 100px);
}

.detail-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.detail-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
}

.detail-meta {
    font-size: 14px;
    color: #666;
}

.detail-content {
    line-height: 1.8;
    font-size: 16px;
    min-height: 200px;
}

.detail-actions {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.back-button {
    margin-bottom: 20px;
}

/* 폼 컨테이너 */
.form-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: calc(100vh - 100px);
}

/* 관리자 페이지 */
.admin-actions {
    margin-bottom: 30px;
}

.admin-users-list {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.user-actions button {
    margin-left: 10px;
    padding: 5px 10px;
    font-size: 14px;
}

/* 권한 체크박스 */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 10px;
}

.permission-group {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
}

.permission-group h4 {
    margin-bottom: 10px;
    font-size: 16px;
}

.permission-checkboxes {
    display: flex;
    gap: 15px;
}

.permission-checkboxes label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

/* 알림 애니메이션 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 주간 스케줄 추가 CSS */
.schedule-week {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 20px;
    cursor: grab;
    user-select: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    min-width: 0;
    max-width: 100%;
}

.schedule-week::-webkit-scrollbar {
    display: none;
}

.no-schedule {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 12px;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    background: #4CAF50;
}

.notification.error {
    background: #f44336;
}

.notification.info {
    background: #2196F3;
}

.schedule-actions {
    display: flex;
    gap: 10px;
}

/* 주간 스켄줄 개선 */
.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-small {
    padding: 5px 15px;
    font-size: 14px;
}

.schedule-week-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.schedule-week {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
    cursor: grab;
    user-select: none;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    scroll-behavior: smooth;
}

/* Chrome, Safari, Opera */
.schedule-week::-webkit-scrollbar {
    display: none;
}

.schedule-week.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* 스크롤 인디케이터 */
.schedule-week-wrapper::before,
.schedule-week-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 2;
}

.schedule-week-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
}

.schedule-week-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0));
}

/* 좌우 스크롤 버튼 */
.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.scroll-button:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.scroll-button.left {
    left: 0;
}

.scroll-button.right {
    right: 0;
}

.scroll-button.hidden {
    opacity: 0;
    pointer-events: none;
}

.day-item {
    min-width: 140px;
    width: 140px; /* 고정 너비 */
    flex-shrink: 0;
    background: white;
    border-radius: 8px;
    padding: 10px;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    position: relative;
}

.day-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.day-item.today {
    background: #e3f2fd;
    border-color: #2196f3;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.day-name {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-bottom: 5px;
}

.day-date {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 3px;
}

.day-month {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-bottom: 10px;
}

.day-schedules {
    min-height: 120px;
    max-height: 180px;
    overflow-y: auto;
    padding: 5px;
}

.day-schedules::-webkit-scrollbar {
    width: 4px;
}

.day-schedules::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

/* 주간 스케줄 미니 아이템 */
.schedule-item-mini {
    font-size: 12px;
    padding: 5px 8px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
    margin-bottom: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: background-color 0.2s;
}

.schedule-item-mini:hover {
    background: rgba(52, 152, 219, 0.2);
}

.schedule-item-mini .schedule-user {
    font-weight: bold;
    color: #2c3e50;
    display: block;
    margin-bottom: 2px;
}

.schedule-item-mini .schedule-content {
    color: #555;
    display: block;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-schedule {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 12px;
}

/* 오늘의 스케줄 상세 */
.today-schedules-detail {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    min-height: 100px;
}

.today-schedules-detail .schedule-item {
    padding: 10px;
    background: white;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.today-schedules-detail p {
    text-align: center;
    color: #999;
    margin: 20px 0;
}

.yesterday-schedules-detail {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    min-height: 100px;
}

.yesterday-schedules-detail .schedule-item {
    padding: 12px 15px;
    background: white;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.yesterday-schedules-detail .schedule-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.yesterday-schedules-detail .schedule-item strong {
    color: #2c3e50;
    margin-right: 10px;
}

.yesterday-schedules-detail p {
    text-align: center;
    color: #999;
    margin: 20px 0;
    font-size: 14px;
}

/* 반응형 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 100;
        height: 100%;
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
    }

    .memo-container {
        flex-direction: column;
        height: auto;
    }

    .memo-list {
        width: 100%;
        height: 200px;
    }
    
    .day-item {
        min-width: 100px;
        width: 120px; /* 모바일에서 더 작게 */
    }
    
    .schedule-week-wrapper {
        margin: 0;
    }
    
    .day-schedules {
        font-size: 11px;
        min-height: 100px;
        max-height: 140px;
    }
    
    .day-date {
        font-size: 20px;
    }
    
    .scroll-button {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .day-item {
        min-width: 80px;
        width: 100px; /* 더 작은 화면에서 */
    }
    
    .schedule-item-mini {
        font-size: 10px;
        padding: 3px 5px;
    }
    
    .day-name {
        font-size: 12px;
    }
    
    .day-date {
        font-size: 18px;
    }
    
    .day-month {
        font-size: 10px;
    }
    
    .day-schedules {
        min-height: 80px;
        max-height: 120px;
    }
    
    .scroll-button {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}
/* ===== 에디터 (파일 첨부 / 이미지 붙여넣기) ===== */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.editor-toolbar .btn-attach {
    padding: 6px 12px;
    background: #f0f2f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.editor-toolbar .btn-attach:hover {
    background: #e2e6ea;
}

.editor-hint {
    font-size: 12px;
    color: #888;
}

textarea.drag-over {
    outline: 2px dashed #4a90d9;
    outline-offset: -2px;
    background: #f0f7ff;
}

/* 본문 내 이미지/첨부파일 */
.content-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 6px;
    border: 1px solid #eee;
}

.content-file {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px 0;
    background: #f0f2f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.content-file:hover {
    background: #e2e6ea;
}

/* 메모 검색 */
.memo-search {
    margin-bottom: 15px;
}

.memo-search input {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.memo-search input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.15);
}
