/* 전역 스타일 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(-45deg, #667eea, #764ba2, #6B8DD6, #8E37D7);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.notice-header {
    border-bottom: #c9c9c9 1px solid;
    padding-bottom: 10px;
}

/* 헤더 영역 */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 20px 20px 30px;
    border-bottom: 2px solid #f0f0f0;
    margin: 0 0 20px 0;
    background-color: #9991;
    border-radius: 10px;
}

.notice-content {
    padding: 0 20px 20px 20px;
    margin: 20px;
}

.btn-notice {
    padding: 10px 20px;
}

.meta-info {
    display: flex;
    padding-left: 5px;
    font-size: 13px;
    color: #5a6268;
    gap: 10px;
    padding-bottom: 10px;
}

.meta-info > * {
    padding-right: 10px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);  /* 흐린 구분선 */
}

.meta-info > *:last-child {
    padding-right: 0;
    border-right: none;  /* 마지막 요소는 구분선 제거 */
}

.title-area {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 10px;
}   

.title-area h2 {
    margin: 0;
}

.notice-title {
    color: #373737;
    text-decoration: none;
    font-weight: 500;
}

.notice-board {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 79%;
    position: relative;  /* 자식 요소의 절대 위치 기준점 */
    padding-bottom: 80px;  /* 페이지네이션 높이만큼 여백 확보 */
}

.button-group {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 30px 20px 0 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.right-buttons form {
    margin: 0;
}

.left-buttons, .right-buttons {
    gap: 10px;
    display: flex;
}

.delete-form {
    display: inline-flex;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

/* 레이아웃 컨테이너 */
#content-container {
    margin-left: 10%;
    max-width: calc(100% * 0.8);
    min-width: 80%;
    overflow: auto;
    position: relative;
}

.content-wrapper {
    padding-top: 20px;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

/* 공통 컴포넌트 스타일 */
.btn {
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    height: 31px;
    font-size: 14px;
    width: 67px;
    text-align: center;
    align-content: center;
}

.right-buttons .btn-danger {
    height: 31px;
    width: 65px;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary {
    background-color: #0370e5;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #fb2a3f;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    text-decoration: underline;
}

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

/* 게시판 컨테이너 */
.notice-board, .notice-form-container, .notice-detail-container {
    background: white;
    border-radius: 10px;
    padding: 20px 20px 20px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 74%;
}

.notice-board {
    padding: 20px 20px 60px 20px;
}

/* 검색 영역 */
.search-box {
    display: flex;
    gap: 10px;
}

.search-box form {
    margin-bottom: 0;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 400px;
    height: 40px;
}

.search-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 40px;
    cursor: pointer;
}

.search-box button {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    height: 40px;
}

.search-box button:hover {
    background-color: #0056b3;
}

/* 테이블 스타일 */
.notice-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    font-size: 15px;
}

.notice-table th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.notice-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
    vertical-align: middle;
    line-height: 1.4;
}

.notice-table tr {
    height: auto;
    min-height: 40px;
}

.notice-table tr:last-child td {
    border-bottom: none;
}

.notice-table tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

/* 테이블 열 너비 */
.notice-table th:nth-child(1) { width: 15%; }
.notice-table th:nth-child(2) { width: 50%; }
.notice-table th:nth-child(3) { width: 20%; }
.notice-table th:nth-child(4) { width: 15%; }

/* 공지사항 제목 스타일 */
.notice-title {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.notice-title:hover {
    color: #007bff;
    text-decoration: underline;
}

/* 중요 공지 스타일 */
.important {
    background-color: rgba(255, 243, 243, 0.5);
}

.important .notice-title {
    color: #dc3545;
    font-weight: bold;
}

/* 뱃지 스타일 */
.badge-important {
    background-color: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 8px;
}

.badge-new {
    background-color: #00a8ff;
    color: white;
    font-size: 9px;
    padding: 0px 5px;
    border-radius: 5px;
    margin-left: 8px;
    font-weight: 300;
    animation: newBadgePulse 2s infinite;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    position: absolute;  /* 절대 위치 설정 */
    bottom: 20px;       /* 하단 여백 */
    left: 0;           /* 좌우 전체 너비 사용 */
    right: 0;          /* 좌우 전체 너비 사용 */
    width: 100%;       /* 전체 너비 */
}

.pagination li {
    margin: 0 5px;
}

.pagination a {
    display: inline-block;
    padding: 5px 7px;
    text-decoration: none;
    color: #007bff;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pagination a.disabled {
    color: #6c757d;
    pointer-events: none;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.65;
}

.pagination a.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,123,255,0.25);
}

.pagination a:not(.disabled):not(.active):hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* 첨부파일 스타일 */
.attachment-area {
    margin-left: 20px;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.attachment-item {
    padding: 0px 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 11px;
    align-items: center;
}

/* 애니메이션 */
@keyframes newBadgePulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    #content-container {
        min-width: 85%;
    }

    .board-header {
        flex-direction: column;
        gap: 10px;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 300px;
        flex: 1;
    }

    .notice-table th:nth-child(4),
    .notice-table td:nth-child(4) {
        display: none;
    }

    .notice-board {
        padding-bottom: 100px;  /* 모바일에서는 여백을 더 확보 */
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
        bottom: 10px;  /* 모바일에서는 하단 여백 줄임 */
    }

    .pagination a {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 13px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .button-group {
        display: inline-flex;
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

.content-header-wrapper {
    position: relative;
    text-align: center;
    padding: 20px 0;
    background: linear-gradient(to right, transparent, rgba(44, 62, 80, 0.02), transparent);
}

.content-header-name {
    display: inline-block;
    position: relative;
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
    padding: 15px 40px;
    margin: 0;
    letter-spacing: 0.5px;
}

/* 제목 위아래 라인 */
.content-header-name::before,
.content-header-name::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background-color: #3498db;
    transition: width 0.3s ease;
}

.content-header-name::before {
    top: 0;
}

.content-header-name::after {
    bottom: 0;
}

/* 호버 효과 - 라인이 좌우로 늘어남 */
.content-header-wrapper:hover .content-header-name::before,
.content-header-wrapper:hover .content-header-name::after {
    width: 100px;
}

/* 작은 아이콘 추가 */
.content-header-icon {
    display: block;
    font-size: 0.9rem;
    color: #95a5a6;
    margin-top: 5px;
}

/* 반응형 대응 */
@media (max-width: 768px) {
    .content-header-name {
        font-size: 1.8rem;
        padding: 15px 0;
        margin-bottom: 20px;
    }
}

@media (max-width: 496px) {
    .content-wrapper {
        padding: 10px 5px 0 5px;
        border-radius: 5px;
    }
    .notice-board {
        padding: 10px 10px 100px 10px;  /* 패딩 축소 */
        margin: 0;  /* 마진 제거 */
        width: 94%;    /* 전체 너비 사용 */
    }

    .board-header {
        padding: 10px;  /* 헤더 패딩 축소 */
        margin-bottom: 10px;
    }

    .search-box {
        width: 100%;  /* 검색박스 전체 너비 사용 */
        padding: 0;   /* 패딩 제거 */
        margin: 0;    /* 마진 제거 */
    }

    .search-box form {
        width: 100%;  /* 폼 전체 너비 사용 */
    }

    .search-box input {
        width: calc(100% - 70px);  /* 버튼 너비를 고려한 입력창 너비 */
        margin-right: 5px;
    }

    .search-box button {
        width: 60px;  /* 검색 버튼 너비 고정 */
        padding: 8px;
    }

    /* 테이블 반응형 조정 */
    .notice-table {
        font-size: 14px;  /* 글자 크기 축소 */
        margin-top: 10px;
    }

    .notice-table th,
    .notice-table td {
        padding: 8px;  /* 셀 패딩 축소 */
    }

    /* 번호와 조회수 컬럼 숨기기 */
    .notice-table th:nth-child(1),
    .notice-table td:nth-child(1),
    .notice-table th:nth-child(4),
    .notice-table td:nth-child(4) {
        display: none;
    }

    /* 제목 컬럼 너비 확대 */
    .notice-table th:nth-child(2),
    .notice-table td:nth-child(2) {
        width: 70%;
    }

    /* 날짜 컬럼 너비 축소 */
    .notice-table th:nth-child(3),
    .notice-table td:nth-child(3) {
        width: 30%;
    }

    #content-container {
        padding: 0;  /* 컨테이너 패딩 제거 */
        margin: 0;
        max-width: 100%;
    }
}