:root {
    --primary-color: #0067a5;
    --accent-color: #0086d6;
    --light-bg: #f5f9fc;
    --header-height: 60px;
    --sidebar-width: 240px;
    --folder-color: #2666a3;
    --danger-color: #e53935;
    --help-button-bg: #a7d7a7;
    --help-button-hover-bg: #8bc38b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: #333;
    line-height: 1.6;
    direction: ltr;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    height: var(--header-height);
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 36px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    background-color: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.action-buttons button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.action-buttons button:hover {
    background-color: var(--accent-color);
}

.main-content {
    margin-top: var(--header-height);
    display: flex;
    flex-direction: column;
    padding: 20px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    height: calc(100vh - 60px);
}

#files-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.programs-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    height: calc(100vh - 140px);
}

#files-view.latest-versions-view {
    max-width: 100%;
    flex: 1;
    overflow: hidden;
}

#files-view.latest-versions-view .programs-container {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    gap: 0;
    height: auto;
    flex: 1;
    overflow: hidden;
}

#files-view.latest-versions-view .latest-versions-table-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-radius: 6px;
    max-height: 65vh;
}

.page-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #333;
    margin-top: 0;
}

.page-header-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.breadcrumb-nav {
    margin-bottom: 20px;
    color: #666;
    font-size: 0.9rem;
}

.breadcrumb-nav a {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

.controls-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.search-container {
    display: flex;
    gap: 5px;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background-color: var(--accent-color);
}

.admin-controls {
    display: flex;
    gap: 10px;
}

.admin-controls button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
}

.admin-controls button:hover {
    background-color: var(--accent-color);
}

#file-upload-input {
    display: none;
}

.file-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
    max-width: 100%;
    overflow-y: auto;
    padding-right: 8px;
}

.file-grid::-webkit-scrollbar {
    width: 8px;
}

.file-grid::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 4px;
}

.file-grid::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.file-grid::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

.item-card {
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 15px;
}

.item-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
    background-color: #f9f9f9;
}

.item-card.selected {
    border-color: var(--primary-color);
    background-color: var(--light-bg);
    box-shadow: 0 4px 12px rgba(0, 102, 165, 0.2);
}

.folder-icon,
.item-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    color: var(--folder-color);
    flex-shrink: 0;
}

.item-name {
    font-weight: 500;
    margin-bottom: 0;
    word-break: break-word;
    flex: 1;
}

.item-info {
    font-size: 0.8rem;
    color: #999;
    white-space: nowrap;
}

.delete-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.item-card:hover .delete-button {
    opacity: 1;
}

.delete-button:hover {
    background-color: #d32f2f;
}

.status-message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.status-message.info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.status-message.success {
    background-color: #e8f5e9;
    color: #388e3c;
    border: 1px solid #c8e6c9;
}

.status-message.error {
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #999;
}

.folder-path {
    font-size: 0.75rem;
    color: #999;
    cursor: pointer;
    margin-top: 5px;
}

.folder-path:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.modal-content {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: 90%;
    max-width: 400px;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 15px;
    color: #333;
}

.modal-message {
    margin-bottom: 20px;
    color: #555;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-buttons button {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.modal-cancel {
    background-color: #f1f1f1;
    color: #333;
}

.modal-cancel:hover {
    background-color: #e1e1e1;
}

.modal-delete {
    background-color: var(--danger-color);
    color: white;
}

.modal-delete:hover {
    background-color: #d32f2f;
}

.search-highlight {
    background-color: rgba(0, 134, 214, 0.1);
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
    font-weight: 500;
}

.help-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--help-button-bg);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 1001;
    transition: background-color 0.2s;
    border: none;
}

.help-button:hover {
    background-color: var(--help-button-hover-bg);
}

.help-button svg {
    fill: white;
    width: 24px;
    height: 24px;
}

.program-details {
    margin-top: 0;
    display: none;
    overflow-y: auto;
    padding-right: 8px;
}

.program-details::-webkit-scrollbar {
    width: 8px;
}

.program-details::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 4px;
}

.program-details::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.program-details::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

.program-details.visible {
    display: block;
}

.program-details h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #333;
}

.versions-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.versions-table-obsolete {
    margin-top: 25px;
}

.versions-table thead {
    background-color: var(--primary-color);
    color: white;
}

.versions-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
}

.versions-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.versions-table tbody tr:hover {
    background-color: #f5f5f5;
}

.versions-table a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.versions-table a:hover {
    text-decoration: underline;
}

.versions-table-latest tbody tr {
    background-color: #d4edda;
}

.versions-table-latest tbody tr td {
    padding: 12px 15px;
}

.versions-table th:nth-child(1),
.versions-table th:nth-child(2) {
    min-width: 80px;
}

.versions-table th:nth-child(3) {
    min-width: 140px;
}

.back-button {
    background-color: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 15px;
    transition: all 0.2s;
}

.back-button:hover {
    background-color: #e1e1e1;
    border-color: #999;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 20px;
}

.login-card {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 100%;
}

.login-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.login-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.login-button {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.login-button:hover {
    background-color: var(--accent-color);
}

.login-message {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #999;
    text-align: center;
}

.login-message a {
    color: var(--primary-color);
    text-decoration: none;
}

.login-message a:hover {
    text-decoration: underline;
}

.see-all-versions-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.2s;
}

.see-all-versions-button:hover {
    background-color: var(--accent-color);
    text-decoration: none;
}

.page-header-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.latest-versions-table-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 6px;
}

.versions-table-latest-only {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
    flex: 1;
    table-layout: fixed;
}

.versions-table-latest-only thead {
    background-color: var(--primary-color);
    color: white;
}

.versions-table-latest-only th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    font-size: 0.95rem;
}

.versions-table-latest-only th:nth-child(3) {
    font-size: 0.95rem;
    font-weight: 600;
}

.versions-table-latest-only td:nth-child(3) {
    font-size: 0.9rem;
    color: #666;
}

.versions-table-latest-only th:nth-child(1),
.versions-table-latest-only th:nth-child(2) {
    font-size: 1.05rem;
    font-weight: 700;
}

.versions-table-latest-only td:nth-child(1),
.versions-table-latest-only td:nth-child(2) {
    font-size: 1rem;
    font-weight: 500;
}

.versions-table-latest-only td {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.versions-table-latest-only tbody tr:hover {
    background-color: #f5f5f5;
}

.versions-table-latest-only a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: block;
    padding: 6px 0;
}

.versions-table-latest-only a:hover {
    text-decoration: underline;
}
