/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: 600;
}
                                       
/* overall layout */
body {
    display: flex;
    flex-direction: column;
}

/* INDEX */
/* style for login page */
.login-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background-color: #f4f4f4;
}

/* login page form design amd position */
.login-page form {
    width: 300px;
    display: flex;
    padding: 20px;
    border-radius: 8px;
    background: white;
    flex-direction: column;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* login page title*/
.login-page h2 {
    color: #333333;
    font-size: 24px;
    margin-bottom: 20px;
}

/* login form */
.login-page input[type="text"],
.login-page input[type="password"] {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    font-size: 14px;
    border-radius: 4px;
    box-sizing: border-box;
    border: 1px solid #ddd;
}

/* login button */
.login-page button {
    width: 100%;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    color: #ffffff;
    margin-top: 12px;
    font-weight: bold;
    border-radius: 4px;
    background-color: #007bff;
    transition: background-color 0.3s;
}

/* login button */
.login-page button:hover {
    background-color: #0056b3;
}

.flash-message {
    margin: 10px 0;
    padding: 10px;
    border-radius: 5px;
}

.flash-message.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.flash-message.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.password-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 20px;
    height: 20px;
}

#registerUserForm .toggle-password {
    position: absolute;
    right: 10px;
    top: 55%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 20px;
    height: 20px;
}

/* header in index */
header {
    display: flex;
    color: #000000;
    padding: 10px 20px;
    align-items: center;
    background-color: #ffffff;
    border-bottom: 2.5px solid #ccc;
}

/* header logo position */
.header-logo {
    flex: 0.7;
}

/* header logo img*/
.header-logo .logo {
    height: 80px;
    width: 150px;
}

.header-logo a {
    text-decoration: none; /* Removes underline */
    display: inline-block; /* Ensures it wraps the image properly */
}

/* header title position */
.header-title {
    flex: 2;
    text-align: justify;
}

/* header title size */
.header-title h1 {
    margin: 0;
    font-size: 1.5rem;
}

/*header confid mssg size */
.confidential-message {
    color: #a00;
    font-weight: 600;
    margin: 5px 0 0 0;
    font-size: 0.75rem;
}

/* header button position */
.header-buttons {
    flex: 1;
    gap: 10px;
    display: flex;
    justify-content: flex-end;
}

/* header button design: admin dashboard */
.header-buttons .dashboard-button {
    color: #333;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #333;
    background-color: #ffdfab;
}

/* header button design: logout */
.header-buttons .logout-button {
    color: #333;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #333;
    background-color: #ffabab;
}

/* header buttons when hover mouse*/
.header-buttons .dashboard-button:hover {
    color: white;
    background-color: #876936;
}

/* header buttons when hover mouse*/
.header-buttons .logout-button:hover {
    color: white;
    background-color: rgb(183, 0, 0);
}

/* layout for contents */
.container {
    display: flex;
    min-height: 100vh;
}

/* spinner for the pdf viewer */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

#loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 60%;
    transform: translate(-50%, -50%);
    z-index: 2;
    background-color: rgba(255, 255, 255, 0); /* transparent */
    width: 100%;
    height: 100%;
}


/* sidebar layout*/
.sidebar {
    min-width: 150px; 
    max-width: 700px;
    width: 350px;
    padding: 20px;
    overflow-y: auto;
    background-color: #f4f4f4;
    position: relative;
    flex-shrink: 0; /* Prevents sidebar from shrinking */
}

/* sidebar title */
.sidebar h2 {
    display: flex;
    font-size: 1.35rem;
    align-items: center;
    margin-bottom: 5px;
    justify-content: space-between;
}

/* sidebar items listing */
.sidebar ul {
    margin-bottom: 5px;
    margin-left: 1.8rem;
    list-style-type: none;
}

/* sidebar pdf item*/
.sidebar li {
    display: flex;
    margin: 8px 0;
    align-items: center;
    justify-content: space-between;
}

/* sidebar pdf item links */
.sidebar a {
    color: #333;
    text-decoration: none;
}

/* sidebar hover style*/
.sidebar a:hover {
    text-decoration: underline;
}

/* Collapsed sidebar state */
.sidebar.collapsed {
    width: 0 !important;
    padding: 0 !important;
    overflow: hidden;
}

.resizer {
    width: 8px;
    cursor: ew-resize;
    height: auto;
    flex-shrink: 0;
}

.search-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.filter-label {
    margin-right: 5px;
    font-weight: bold;
}

input[type="text"],
select {
    padding: 5px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.apply-button {
    padding: 5px 10px;
    background-color: #ffe100;
    color: black;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.apply-button:hover {
    background-color: #915e00;
}

.reset-button {
    padding: 5px 10px;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
}

/* dept layout */
.department-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: solid 0.5px grey;
}

/* dept title size and design */
.department-heading {
    color: rgb(86, 0, 0);
    margin-top: 1rem;
    font-size: 1.3rem;
    font-weight: bold;
}

/* dept icons size */
.dept-icons {
    margin-bottom: -18px;
}

.dept-icons .add-folder-icon {
    width: 18px;
    cursor: pointer;
}

/* folder layout */
.folder-container{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

/* folder icon size */
.folder-icon img, .subfolder-icon img,
.subsubfolder-icon img{
    width: 18px;
    margin-right: 10px;
}

/* folder name design */
.folder-name, .subfolder-name, .subsubfolder-name{
    flex-grow: 1;
    overflow-wrap: break-word;
}

/* other related folder icons sizes */
.folder-icons .add-pdf-icon, 
.folder-icons .edit-folder-icon, 
.folder-icons .delete-icon {
    width: 12px;
    cursor: pointer;
    margin-left: 5px;
}

.subfolder-icons .add-pdf-icon, 
.subfolder-icons .edit-folder-icon, 
.subfolder-icons .delete-icon,
.subfolder-icons .add-subfolder-icon {
    width: 12px;
    cursor: pointer;
    margin-left: 5px;
}

.subsubfolder-icons .add-pdf-icon, 
.subsubfolder-icons .edit-folder-icon, 
.subsubfolder-icons .delete-icon {
    width: 12px;
    cursor: pointer;
    margin-left: 5px;
}

.folder-icons .add-subfolder-icon {
    width: 15px;
    cursor: pointer;
    margin-left: 5px;
}

.subsubfolder-icon .folder-icon {
    width: 12px;
    margin-left: 5px;
}

/* pdf items layout */
.pdf-item {
    margin-bottom: 5px;
    overflow-wrap: break-word;
}

/* make pdf item's name can display in more than one line */
.pdf-item a {
    width: 80%;
    font-size: 0.8rem;
    white-space: normal; /* allow line breaks within the word */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* pdf items delete icon position */
.pdf-item .delete-pdf-icon {
    width: 10px;
    cursor: pointer;
    margin-left: auto;
}

/* welcome message position and design */
#welcome-message {
    color: #555;
    margin-top: 50px;
    text-align: center;
}

/* welcome message size */
#welcome-message h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}


/* pdf viewer layout */
.pdf-viewer-container {
    flex: 1;
    overflow-y: auto;
    background-color: #ffffff;
    transition: margin-left 0.2s ease;
}

/* pdf viewer item size */
#pdf-viewer canvas {
    display: block;
    margin: 0 auto 20px;
}

/* ADMIN DASHBOARD */
/* admin dashboard main layout */
body.admin-dashboard {
    margin: 0;
    display: flex;
    align-items: center;
    flex-direction: column;
    background-color: #f4f4f4;
}

/* dashboard header design */
.dashboard-header {
    width: 100%;
    padding: 10px 0;
    text-align: center;
    margin-bottom: 20px;
    justify-content: center;
    border: 1px solid #ccc;
    background-color: #ffffff;
}

/* dashboard title position and size */
.dashboard-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #333;
}

/* admin actions main page title design */
.admin-section h2 {
    font-size: 1.5rem;
    color: black;
    margin-bottom: 10px;
    border-bottom: 2px solid #161616;
    padding-bottom: 5px;
}

.admin-section button {
    background-color: #007f28;
    color: white;
    border: none;
    padding: 10px 15px;
    margin: 5px 0;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
}

.admin-section button:hover {
    background-color: #004404;
}

/* dashboard content page layout */
.dashboard-tabs {
    flex: 1;
    width: 100%;
    padding: 20px;
    font-size: 1rem;
    max-width: 800px;
    margin-bottom: 20px;
}

/* edit user style */
/* Styling checkboxes for better spacing and readability */
#edit-dept-container .checkbox-container {
    margin-bottom: 10px; /* Adds space between each checkbox */
}

#edit-dept-container input[type="checkbox"] {
    margin-right: 5px; /* Adds space between the checkbox and the label */
}


/* permission table design */
.permissions-table, .users-table {
    width: 130%;
    margin-top: 15px;
    border-collapse: collapse;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* permission table content design */
.permissions-table th, .users-table th,
.permissions-table td, .users-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #333;
}

/* permissiontable background color */
.permissions-table th, .users-table th {
    background-color: #f2f2f2;
}

input[type="text"], input[type="password"], select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

input[type="text"]:focus, input[type="password"]:focus, select:focus {
    border-color: #007bff;
}


/* for log */
.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table th, .logs-table td {
    border: 1px solid #ddd;
    padding: 8px;
}

.logs-table th {
    background-color: #f4f4f4;
    text-align: left;
}
