/* admin_style.css - Optimized and Refined Version */

:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --success-color: #28a745;
    --success-hover: #218838;
    --danger-color: #dc3545;
    --bg-color: #f4f7f9;
    --widget-bg-color: #ffffff;
    --text-color: #333;
    --text-light-color: #666;
    --border-color: #dee2e6;
    --border-radius: 5px; /* Radius 더 줄임 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px; /* 기본 폰트 크기 더 줄임 */
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* 상단 정렬 */
    min-height: 100vh;
    padding: 15px 10px; /* 전체 패딩 줄임 */
    box-sizing: border-box;
}

/* --- 컨테이너 --- */
.login-container, .admin-container, .edit-container {
    background-color: var(--widget-bg-color);
    padding: 20px; /* 패딩 줄임 */
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0,0,0,0.07); /* 그림자 더 약하게 */
    width: 100%;
}

.login-container { max-width: 340px; margin-top: 30px; }
.admin-container { max-width: 760px; }
.edit-container { max-width: 680px; }

h1 {
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 18px; /* 마진 줄임 */
    text-align: center;
    font-size: 1.6em; /* 폰트 크기 줄임 */
}

/* --- 헤더 및 버튼 --- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px; /* 마진 줄임 */
    padding-bottom: 12px; /* 패딩 줄임 */
    border-bottom: 1px solid var(--border-color);
}
.admin-header h1 {
    margin: 0;
    font-size: 1.4em; /* 폰트 크기 줄임 */
    text-align: left;
}
.admin-header .user-info {
    font-size: 0.85em; /* 폰트 크기 줄임 */
    color: var(--text-light-color);
}
.admin-header .user-info strong {
    color: var(--text-color);
}
.admin-header a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.button, button {
    display: inline-block;
    padding: 9px 16px; /* 패딩 줄임 */
    border: none;
    border-radius: 3px; /* Radius 줄임 */
    font-size: 0.9em; /* 폰트 크기 줄임 */
    font-weight: 600;
    color: var(--text-color); /* Use text color instead */
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    text-align: center;
}
button[type="submit"], .button.primary {
    background-color: transparent !important; /* Remove background color */
}
button[type="submit"]:hover, .button.primary:hover {
    background-color: transparent !important; /* Remove background color */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.button.create {
    background-color: transparent !important; /* Remove background color */
}
.button.create:hover {
    background-color: transparent !important; /* Remove background color */
}
.button.cancel {
    background-color: transparent !important; /* Remove background color */
}
.button.cancel:hover {
    background-color: transparent !important; /* Remove background color */
}

/* --- 폼 요소 --- */
.input-group {
    margin-bottom: 12px; /* 마진 줄임 */
    text-align: left;
}
label {
    display: block;
    margin-bottom: 5px; /* 마진 줄임 */
    color: var(--text-light-color);
    font-weight: 600;
    font-size: 0.85em; /* 폰트 크기 줄임 */
}
input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    padding: 9px; /* 패딩 줄임 */
    border: 1px solid var(--border-color);
    border-radius: 3px; /* Radius 줄임 */
    box-sizing: border-box;
    font-size: 0.9em; /* 폰트 크기 줄임 */
    transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.12);
}
textarea {
    min-height: 300px; /* 최소 높이 확대 */
    line-height: 1.5;
    resize: vertical;
}
.button-group {
    margin-top: 12px; /* 마진 줄임 */
    display: flex;
    justify-content: flex-end;
    gap: 6px; /* 간격 줄임 */
}

/* --- 테이블 --- */
.notice-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px; /* 마진 줄임 */
}
.notice-table th, .notice-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 10px 8px; /* 패딩 줄임 */
    text-align: left;
    vertical-align: middle;
    font-size: 0.85em; /* 폰트 크기 줄임 */
}
.notice-table thead th {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-light-color);
}
.notice-table td.actions {
    text-align: right;
    width: 110px; /* 너비 줄임 */
}
.notice-table .actions a {
    margin: 0 5px; /* 마진 줄임 */
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.notice-table .actions a.delete {
    color: var(--danger-color);
}

/* --- 메시지 --- */
.error-message, .success-message {
    padding: 9px; /* 패딩 줄임 */
    border-radius: 3px; /* Radius 줄임 */
    margin-bottom: 12px; /* 마진 줄임 */
    font-size: 0.85em; /* 폰트 크기 줄임 */
    text-align: center;
}
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 버튼을 링크처럼 보이게 하는 스타일 */
.button-link {
    background: none;
    color: var(--primary-color); /* 링크 색상 */
    border: none;
    padding: 0;
    font-size: 0.85em; /* 폰트 크기 줄임 */
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}
.button-link:hover {
    color: var(--primary-hover);
    text-decoration: none;
}
.button-link.delete { /* 삭제 버튼은 빨간색으로 */
    color: var(--danger-color);
}
.button-link.delete:hover {
    color: #a71d2a;
}

/* --- 상태 표시 (뱃지 스타일) --- */
.status-on {
    color: #fff !important; /* 흰색 텍스트 강제 적용 */
    background-color: #28a745 !important; /* 녹색 배경 강제 적용 */
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em; /* 폰트 크기 조정 */
    font-weight: 900 !important; /* 매우 굵게 */
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important; /* 진한 그림자 */
    border: 1px solid #1e7e34 !important; /* 더 진한 녹색 테두리 */
}
.status-off {
    color: #fff !important; /* 흰색 텍스트 강제 적용 */
    background-color: #dc3545 !important; /* 빨간색 배경 강제 적용 */
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em; /* 폰트 크기 조정 */
    font-weight: 900 !important; /* 매우 굵게 */
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important; /* 진한 그림자 */
    border: 1px solid #bd2130 !important; /* 더 진한 빨간색 테두리 */
}

/* 숨김 버튼 스타일 - 모든 가능한 선택자 포함 */
.button.hidden, 
.button-link.hidden,
a.hidden,
button.hidden,
[class*="hidden"] {
    background-color: transparent !important; /* Remove background color */
    border: 2px solid var(--border-color) !important; /* Adjust border color */
    padding: 6px 12px !important;
    border-radius: 4px;
    font-size: 0.85em !important;
    font-weight: 900 !important; /* 매우 굵게 */
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    display: inline-block !important;
    min-width: 50px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important; /* 텍스트 그림자 */
}
.button.hidden:hover, 
.button-link.hidden:hover,
a.hidden:hover,
button.hidden:hover,
[class*="hidden"]:hover {
    background-color: transparent !important; /* Remove background color */
    border-color: var(--primary-hover) !important;
    color: var(--text-color) !important;
    text-decoration: none !important;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3) !important;
}

/* Responsive Design for Admin */
@media (max-width: 768px) {
    body {
        padding: 10px; /* 모바일 패딩 더 줄임 */
    }
    .login-container, .admin-container, .edit-container {
        padding: 15px; /* 모바일 패딩 줄임 */
        border-radius: 0; /* 모바일에서는 모서리 둥글게 하지 않음 */
        box-shadow: none; /* 모바일에서는 그림자 제거 */
    }
    h1 {
        font-size: 1.4em;
        margin-bottom: 12px;
    }
    .admin-header {
        flex-direction: column; /* 모바일에서 세로로 정렬 */
        align-items: flex-start;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    .admin-header h1 {
        font-size: 1.3em;
        margin-bottom: 4px;
    }
    .admin-header .user-info {
        font-size: 0.8em;
    }
    .button, button {
        padding: 7px 12px;
        font-size: 0.85em;
    }
    .input-group {
        margin-bottom: 8px;
    }
    label {
        font-size: 0.8em;
        margin-bottom: 3px;
    }
    input[type="text"], input[type="password"], textarea, select {
        padding: 7px;
        font-size: 0.85em;
    }
    textarea {
        min-height: 200px; /* 모바일에서 최소 높이 조정 */
    }
    .button-group {
        flex-direction: column; /* 모바일에서 버튼 세로 정렬 */
        gap: 4px;
    }
    .button-group .button, .button-group button {
        width: 100%;
    }
    .notice-table th, .notice-table td {
        padding: 8px 6px;
        font-size: 0.75em;
    }
    .notice-table td.actions {
        width: auto;
        text-align: center;
    }
    .notice-table .actions a, .notice-table .actions .button-link {
        margin: 0 2px;
        font-size: 0.75em;
    }
    .error-message, .success-message {
        padding: 7px;
        font-size: 0.8em;
        margin-bottom: 8px;
    }
}
