* { 
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 0px;
    background: transparent; /* Optional: Hide scrollbar track */
}

body, html {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    height: 100%;
}

body, input, textarea, select, button {
    font-family: inherit;
}



/* -----------------------------------------------------------------------------------------------------------------
COLORS
----------------------------------------------------------------------------------------------------------------- */
:root {
    --background: #f4f4f4;
    --primary: #007bff;
    --secondary: #333333;
    --container: #ffffff;
    --borders: #cccccc;
    --dark-text: #333333;
    --light-text: #f4f4f4;
    --error: #ff0000;
  }



/* -----------------------------------------------------------------------------------------------------------------
STYLES PARA SA LAHAT
----------------------------------------------------------------------------------------------------------------- */
main {
    padding-top: 130px;
    margin-left: 30px;
    margin-right: 30px;
    min-height: 100vh;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

input:focus,
textarea:focus {
    outline: 1px solid var(--primary)
}

button:hover {
    opacity: 0.6;
}



/* -----------------------------------------------------------------------------------------------------------------
LOGIN PAGE
----------------------------------------------------------------------------------------------------------------- */
.login-box {
    background-color: var(--container);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 300px;
    text-align: center;
}

.logo img {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.login-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--dark-text)
}

.input-username,
.input-password {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--borders);
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.login-button {
    width: 100%;
    padding: 10px;
    background-color: var(--primary);
    color: var(--light-text);
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: ease 0.2s;
}

.error-message {
    color: var(--error);
    padding: 10px;
    text-align: center;
    margin-bottom: 10px;
    transition: opacity 0.5s ease-out;
}



/* -----------------------------------------------------------------------------------------------------------------
HEADER
----------------------------------------------------------------------------------------------------------------- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.navbar {
    background: var(--secondary);
    color: var(--light-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.0);
}

.brand {
    display: flex;
    align-items: center;
}

.brand img {
    height: 40px;
    margin-right: 10px;
}

.brand h1 {
    font-size: 18px;
    white-space: nowrap;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 230px;
    overflow: hidden;
}

.user-avatar {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--borders);
}

.user-avatar[alt="User Avatar"] {
    display: none;
}

.default-icon {
    font-size: 24px;
    background: var(--container);
    color: var(--dark-text);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--borders);
}

.username {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}



/* -----------------------------------------------------------------------------------------------------------------
NAVIGATION BAR
----------------------------------------------------------------------------------------------------------------- */
.top-bar {
    background: var(--background);
    color: var(--dark-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    margin: 0px 30px;
    padding: 10px 0px;
    border-bottom: 1px solid var(--secondary);
}
    
.back-button {
    display: flex;
    align-items: top;
    gap: 10px;
}

.back-button .circle {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.back-button .circle:hover {
    background: #bbbbbb;
}

.top-bar-title {
    align-content: center;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--container);
    padding: 5px;
    border-radius: 5px;
    border: 1px solid var(--borders);
}

.input-search {
    border: none;
    outline: none;
    padding: 8px;
}

.search-container .search-icon {
    cursor: pointer;
    color: #555555;
    transition: 0.3s;
}

.search-container .search-icon:hover {
    color: #000000;
}



/* -----------------------------------------------------------------------------------------------------------------
BOXES
----------------------------------------------------------------------------------------------------------------- */
.dashboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: start;
    align-items: center;
    gap: 15px;
    background: var(--background);
    margin: 0;
    padding: 20px 0px;
}

.box {
    flex: 0 1 auto;
    width: 150px;
    height: 150px;
    background: var(--container);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 10px;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.box:hover {
    transform: translateY(-5px);
    box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.3);
}

.box i {
    font-size: 40px;
    margin-bottom: 10px;
    color: var(--secondary);
}

.title {
    font-size: 16px;
    font-weight: bold;
}

.description {
    font-size: 12px;
    color: gray;
}



/* -----------------------------------------------------------------------------------------------------------------
SUNOD NA SECTION
----------------------------------------------------------------------------------------------------------------- */
.section-title {
    padding: 10px 0px;
}

.quicklinks {
    display: flex;
    gap: 8px;
    padding: 10px 0px;
}

.ql-tab {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

a {
    text-decoration: none;
    color: #000;
}

.ql-tab:hover {
    background-color: #f0f0f0;
}

.ql-tab i {
    font-size: 18px;
    margin-right: 8px;
}


/* -----------------------------------------------------------------------------------------------------------------
ALL FILES
----------------------------------------------------------------------------------------------------------------- */
.navigation-tabs {
    display: flex;
    gap: 15px;
    padding: 15px 0 30px 0;
}

.tab {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--container);
    border: 1px solid var(--borders);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tab i {
    font-size: 18px;
    margin-right: 10px;
    color: var(--primary);
}

.files-table {
    background: var(--background);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.files {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--container);
}

/* Table headers and cells common styles */
.files th, .files td {
    padding: 14px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Table header specific styles */
.files th {
    background-color: var(--secondary);
    color: var(--light-text);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Table cell specific styles */
.files td {
    border-bottom: 1px solid #eaeaea;
}

.files tbody tr {
    transition: background-color 0.2s ease;
}

.files tbody tr:hover {
    background-color: #f5f8ff;
}

/* Column Width Definitions */
.files .col-name { width: 320px; }
.files .col-category { width: 160px; }
.files .col-year { width: 100px; }
.files .col-modified { width: 140px; }
.files .col-uploaded { width: 160px; }

/* Column Content Styling */
.files td.col-category { 
    color: var(--secondary); 
}

/* File name column specific styling */
/* File name column specific styling */
.files .col-name a {
    display: flex;
    align-items: center;
    color: var(--dark-text); /* Changed from var(--primary) to var(--dark-text) */
    font-weight: 500;
    transition: color 0.2s ease;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.files .col-name a:hover {
    color: var(--secondary); /* Changed from #0056b3 to var(--secondary) */
    text-decoration: none; /* Changed from underline to none */
}

.files .file-icon {
    font-size: 18px;
    color: var(--secondary);
    margin-right: 10px;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

/* Style for clickable rows */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clickable-row:hover {
    background-color: #f8f9fa;
}

/* Improved menu popup */
.menu-popup {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #eaeaea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    z-index: 200;
    right: 0;
    border-radius: 8px;
    min-width: 150px;
    transform-origin: top right;
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform: scale(0.95);
    opacity: 0;
    top: 100%;
}

/* Empty state styling */
tbody tr td[colspan] {
    padding: 40px 0;
    text-align: center;
    color: #777;
    font-style: italic;
}


/* -----------------------------------------------------------------------------------------------------------------
POPUP NG UPLOAD
----------------------------------------------------------------------------------------------------------------- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.popup {
    background: var(--container);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    width: 400px;
    text-align: center;
    transition: ease-in-out 5s;
}

.popup h2 {
    margin-top: 0;
}

.popup label {
    display: block;
    margin: 10px 0 5px;
}

.popup input,
.popup textarea,
.popup select,
.popup button {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
}

.popup textarea {
    resize: none;
    height: 80px;
}

.popup-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
  }

  .popup-buttons button {
    width: 100%;
    padding: 10px 25px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
  }






/* Additional styles for the upload functionality */
.upload-box p {
    margin: 0;
    padding: 10px;
}

.upload-box.dragging {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    border-style: solid;
}

#uploadMessage {
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
}

#uploadMessage.error {
    background-color: #f8d7da;
    color: #721c24;
}

#uploadMessage.success {
    background-color: #d4edda;
    color: #155724;
}

/* Improve the file list UI */
#fileList li {
    padding: 8px 10px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-remove {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.file-remove:hover {
    background-color: #c82333;
}














.upload-box {
    width: 100%;
    height: 100px;
    border: 2px dashed #aaa;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    background-color: #f9f9f9;
    transition: 0.3s;
    margin-bottom: 10px;
}

.upload-box:hover {
    background-color: #e9ecef;
}


.upload-box.dragging {
    background-color: #d1ecf1;
    border-color: #17a2b8;
}

/* PREVIEW NG SELECTED FILE */
#fileList {
    list-style: none;
    padding: 0;
    text-align: left;
    max-height: 100px;
    overflow-y: auto;
}

#fileList li {
    background: #e9ecef;
    padding: 5px;
    margin: 5px 0;
    border-radius: 5px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-remove {
    background: red;
    color: white;
    border: none;
    padding: 2px 5px;
    cursor: pointer;
    border-radius: 3px;
}

/* -----------------------------------------------------------------------------------------------------------------
FOOTER
----------------------------------------------------------------------------------------------------------------- */
footer {
    background: #f4f4f4;
    color: red;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    height: 30px;
    margin: 0px 30px;
    padding: 10px 0px;
    border-top: 1px solid #555;
}



/* -----------------------------------------------------------------------------------------------------------------
DOCUMENT VIEW PAGE
----------------------------------------------------------------------------------------------------------------- */
.document-view {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 25px;
    background: var(--container);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 600px;
}

.document-info {
    padding: 25px;
    border-right: 1px solid #eaeaea;
    background-color: #f9f9f9;
}

.document-info h1 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--secondary);
    word-break: break-word;
}

.document-metadata {
    margin-bottom: 25px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.metadata-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    margin-bottom: 10px;
    font-size: 14px;
}

.metadata-item .label {
    font-weight: bold;
    color: #555;
}

.metadata-item .value {
    color: var(--dark-text);
    word-break: break-word;
    overflow-wrap: break-word;
}

.document-description {
    margin-bottom: 25px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.document-description h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--secondary);
}

.document-description p {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    word-break: break-word;
}

.document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.document-actions .btn {
    flex: 1 1 calc(50% - 5px);
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.document-actions .primary-btn {
    background-color: var(--primary);
    color: white;
    border: none;
}

.document-actions .secondary-btn {
    background-color: #f0f0f0;
    color: var(--dark-text);
    border: 1px solid #ddd;
}

.document-actions .danger-btn {
    background-color: #fff;
    color: var(--error);
    border: 1px solid var(--error);
}

.document-actions .primary-btn:hover {
    background-color: #0069d9;
}

.document-actions .secondary-btn:hover {
    background-color: #e5e5e5;
}

.document-actions .danger-btn:hover {
    background-color: #fff0f0;
}

.document-preview {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    position: relative;
    overflow: auto;
}

.preview-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border: 1px solid #eaeaea;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.preview-pdf {
    width: 100%;
    height: 70vh;
    border: none;
}

.preview-text {
    width: 100%;
    height: 70vh;
    padding: 15px;
    overflow: auto;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.6;
    background-color: #f5f5f5;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    white-space: pre-wrap;
}

.no-preview {
    text-align: center;
    padding: 30px;
    color: #777;
}

.file-icon-large {
    font-size: 60px;
    color: var(--secondary);
    margin-bottom: 15px;
    opacity: 0.8;
}

.no-preview p {
    margin-bottom: 20px;
}

/* Version history section */
.version-history {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
}

.version-history h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--secondary);
}

.version-list {
    max-height: 200px;
    overflow-y: auto;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.version-number {
    font-weight: bold;
    color: var(--primary);
}

.version-date {
    color: #777;
    font-size: 12px;
}

/* Responsive design */
@media (max-width: 992px) {
    .document-view {
        grid-template-columns: 1fr;
    }
    
    .document-info {
        border-right: none;
        border-bottom: 1px solid #eaeaea;
    }
}


/* -----------------------------------------------------------------------------------------------------------------
MODAL STYLES (Delete Confirmation)
----------------------------------------------------------------------------------------------------------------- */
.modal {
    display: none; /* Initially hidden */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 1001; /* Higher than other overlays */
}

.modal-content {
    background: var(--container);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 400px;
    max-width: 90vw;
    text-align: center;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--secondary);
    font-size: 20px;
}

.modal-content p {
    margin-bottom: 20px;
    color: var(--dark-text);
    font-size: 16px;
    line-height: 1.4;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.modal-buttons .danger-btn {
    background-color: var(--error);
    color: white;
}

.modal-buttons .danger-btn:hover {
    background-color: #cc0000;
    opacity: 1;
}

.modal-buttons .secondary-btn {
    background-color: #f0f0f0;
    color: var(--dark-text);
    border: 1px solid var(--borders);
}

.modal-buttons .secondary-btn:hover {
    background-color: #e5e5e5;
    opacity: 1;
}

/* Show modal when active */
.modal.show {
    display: flex !important;
}
























/* Filters Section */
.filters-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.filter-tab i {
    color: var(--primary);
    font-size: 14px;
}

.filter-tab span {
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.filter-tab select {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    background: white;
    min-width: 120px;
}

.filter-tab select:focus {
    outline: 2px solid var(--primary);
    border-color: var(--primary);
}

/* Results Info */
.results-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.filter-active {
    color: var(--primary);
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.pagination-btn:hover {
    background: var(--primary-dark);
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-tab {
        justify-content: space-between;
    }
    
    .filter-tab select {
        min-width: 100px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
}