/* =================================
   DOCUMENT PREVIEW STYLES
   ================================= */

/* --- Kiểu cho nút "Xem trước" --- */
.btn.preview-button {
    border: 2px solid #00bcd4;
    color: #00bcd4;
    background-color: transparent;
    font-weight: 600;
  
}

.btn.preview-button:hover {
     border: 2px solid #02cfeb;
    background-color: transparent;
      color: #00bcd4;
    box-shadow: 0 4px 15px rgba(0, 96, 109, 0.26);
     transform: translateY(-12px);
}



body.dark-theme .btn.preview-button:hover {
    border-color: #00ff9d;
   background-color: transparent;
    color: #00ff9d;
    box-shadow: 0 4px 15px rgba(0, 255, 157, 0.2);
}
/* --- Kiểu cho khung xem trước tài liệu --- */
.preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Luôn nằm trên cùng */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.preview-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.preview-container {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    background-color: #333;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.preview-overlay.visible .preview-container {
    transform: scale(1);
}

.preview-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
}

#close-preview-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background-color: white;
    color: #333;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 11;
}


/* --- Che nút "Mở cửa sổ mới" của Google Drive --- */
.preview-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 55px;
    background-color: #1e1e1e; /* Đảm bảo cùng màu nền với khung xem trước */
    z-index: 10;
}
/* --- Thêm các quy tắc mới này vào tab.css --- */
/* Trong tab.css */
.modal-actions {
	display: flex;
	flex-direction: column;
	width: 23%; /* << THAY ĐỔI TỪ 50% XUỐNG 40% */
	align-items: stretch;
}
/* =================================
   KIỂU DÁNG NÚT XEM TRƯỚC (ĐÃ SỬA)
   ================================= */

/* --- Kiểu dáng chung cho nhóm nút xếp chồng --- */
.modal-actions .btn {
    margin: 0 !important; /* Loại bỏ khoảng cách giữa các nút */
    transition: transform 0.2s ease-out; /* Hiệu ứng chuyển động mượt mà */
    position: relative; /* Bắt buộc để z-index hoạt động */
    text-align: center;
    width: 100%;
}

/* --- Chỉnh nút Xem trước (ở trên) để nối xuống dưới --- */
/* Trong review.css */

/* --- Chỉnh nút Xem trước (ở trên) --- */
.modal-actions .preview-button {
    border-bottom: none; /* Bỏ đường viền dưới */
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
     padding-top: 0.2rem;
    padding-bottom: 0.8rem;
}

/* --- Chỉnh nút Tải về (ở dưới) --- */
.modal-actions .download-button-no-pass {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    /* Kéo nút lên để lấp khoảng trống của viền nút trên và dùng !important để ưu tiên */
    margin-top: -20% !important; /* << ĐÂY LÀ THAY ĐỔI QUAN TRỌNG NHẤT */
}

/* --- Hiệu ứng Hover để tạo cảm giác tách rời --- */


.modal-actions .download-button-no-pass:hover {
    transform: translateY(0px); 
    z-index: 1;
}
/* --- Chỉnh sửa cho Giao diện tối (Dark Theme) --- */
body.dark-theme .btn.preview-button {
    border-color: #00ff9d;
    color: #00ff9d;
    border-bottom: 1px solid rgba(0, 255, 157, 0.5);
}



/* --- Kiểu cho khung xem trước tài liệu (giữ nguyên) --- */
.preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.preview-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.preview-container {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    background-color: #333;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.preview-overlay.visible .preview-container {
    transform: scale(1);
}

.preview-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
}

#close-preview-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background-color: white;
    color: #333;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 11;
}

#close-preview-btn:hover {
    transform: rotate(90deg);
    background-color: #f0f0f0;
}

.preview-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 55px;
    background-color: #1e1e1e;
    z-index: 10;
}
