/* 기본 리셋 */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    display: flex;
    min-height: 100vh;
}

/* 좌측 플로팅 사이드바 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background-color: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    padding: 20px;
    z-index: 1000;
}

.sidebar h1 {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

/* 검색 폼 스타일 */
.search-form {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.search-form h3 {
    margin-top: 0;
    font-size: 1em;
    color: #007bff;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
}

.date-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-range input {
    flex: 1;
}

.date-range span {
    color: #666;
    font-size: 0.9em;
}

.search-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.search-buttons button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.btn-search {
    background-color: #007bff;
    color: white;
}

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

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

.btn-reset:hover {
    background-color: #545b62;
}

.btn-refresh {
    background-color: #28a745;
    color: white;
    width: 100%;
    margin-bottom: 15px;
    padding: 10px;
}

.btn-refresh:hover {
    background-color: #218838;
}

/* 문서 목록 스타일 */
.document-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.document-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.document-item:hover {
    background-color: #f9f9f9;
}

.document-item:last-child {
    border-bottom: none;
}

.document-info {
    flex: 1;
}

.document-delete-btn {
    background-color: #dc3545;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.document-item:hover .document-delete-btn {
    opacity: 1;
}

.document-delete-btn:hover {
    background-color: #c82333;
}

.document-title {
    font-weight: bold;
    color: #007bff;
    font-size: 0.95em;
    margin-bottom: 5px;
}

.document-date {
    font-size: 0.85em;
    color: #666;
}

.document-category {
    font-size: 0.8em;
    color: #888;
    margin-top: 3px;
}

/* 벌크 액션 바 */
.bulk-action-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border-radius: 8px;
    margin-bottom: 10px;
    color: white;
    font-size: 0.9em;
    font-weight: 600;
    animation: slideDown 0.2s ease-out;
}

.bulk-action-bar.visible {
    display: flex;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bulk-action-bar .bulk-count {
    font-size: 1em;
}

.bulk-action-bar .btn-bulk-action {
    padding: 6px 14px;
    border: 2px solid white;
    border-radius: 6px;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.bulk-action-bar .btn-bulk-action:hover {
    background: white;
    color: #ee5a24;
}

.bulk-action-bar .btn-bulk-cancel {
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 6px;
    background: transparent;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
    white-space: nowrap;
}

.bulk-action-bar .btn-bulk-cancel:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* 문서 목록 체크박스 */
.doc-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
    margin-right: 8px;
    flex-shrink: 0;
}

/* 메인 콘텐츠 영역 */
.main-content {
    margin-left: 320px;
    padding: 20px;
    width: calc(100% - 320px);
}

.vertical-layout {
    display: block;
}

.vertical-layout .section {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
}

.section-title {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.section-title .btn-jump {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.section-title .btn-jump:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.section-title .btn-jump:active {
    transform: translateY(0);
}

iframe {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error {
    color: #dc3545;
    padding: 20px;
    text-align: center;
}

.no-results {
    text-align: center;
    padding: 30px;
    color: #666;
}

/* Toast 메시지 컨테이너 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #28a745;
}

.toast.error {
    background-color: #dc3545;
}

.toast.warning {
    background-color: #ffc107;
    color: #333;
}

/* Footer 스타일 */
.footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.85em;
    border-top: 1px solid #ddd;
    margin-top: 20px;
}

.footer a {
    color: #007bff;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 반응형 */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    .main-content {
        margin-left: 280px;
        width: calc(100% - 280px);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        box-shadow: none;
        border-bottom: 2px solid #ddd;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}
