:root {
    --sidebar-width: 280px;
    --primary-color: #0d6efd;
    --sidebar-bg: #212529;
}

body {
    min-height: 100vh;
    background-color: #f8f9fa;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background-color: var(--sidebar-bg);
    color: white;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    z-index: 1000;
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    padding-bottom: 4rem;
    transition: all 0.3s;
}

.nav-link {
    color: rgba(255, 255, 255, .8);
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background-color: var(--primary-color);
}

.nav-link i {
    font-size: 1.2rem;
}

.user-info {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-name {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.user-role {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 1rem;
}

/* Sticky Mobile Header Fixes */
@media (max-width: 768px) {
    .sidebar {
        left: 0 !important;
        right: auto !important;
        transform: translateX(-100%);
        width: 280px;
        z-index: 2000;
        overflow-y: auto;
        overflow-x: hidden;
        max-height: 100vh;
        height: auto;
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.5);
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 15px !important;
        padding-bottom: 60px !important;
    }

    .mobile-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 0 1rem;
        height: 60px;
        background: white;
        border-bottom: 1px solid #eef2f7;
        position: sticky;
        top: 0;
        z-index: 1050;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    .mobile-header .app-name {
        font-weight: 800;
        font-size: 1.2rem;
        color: var(--sidebar-bg);
        letter-spacing: -0.02em;
    }

    .top-bar {
        margin-bottom: 1rem;
        padding: 0.75rem;
    }

    .top-bar h4 {
        font-size: 1.1rem;
    }

    .table th,
    .table td {
        padding: 8px 4px !important;
        font-size: 0.85rem !important;
    }

    .text-truncate-mobile {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal !important;
        word-break: break-all;
        max-width: 100% !important;
        line-height: 1.2;
    }
}

.top-bar {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-toggle,
.mobile-header {
    display: none;
}

/* Login Page Styles */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 450px;
}

.login-logo {
    height: 80px;
}

/* Common File Icons */
.file-icon {
    font-size: 1.5rem;
    color: #6c757d;
}

.file-icon.folder {
    color: #ffc107;
}

.file-icon.file {
    color: #0d6efd;
}

/* Upload Manager Styles */
#upload-manager {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    z-index: 2000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#upload-manager.show {
    display: block;
}

#upload-manager.minimized {
    height: 50px;
    width: 250px;
}

.upload-header {
    background: #212529;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.upload-list {
    max-height: 300px;
    overflow-y: auto;
    background: white;
}

.upload-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.2s;
}

.upload-item:last-child {
    border-bottom: none;
}

.upload-item-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.upload-filename {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.upload-progress-container {
    height: 6px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: #0d6efd;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-status-icon {
    font-size: 1rem;
}

@keyframes slideIn {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Premium Card Styles */
.card {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
}

.table thead th {
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: #6c757d;
    border-top: none;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    background: #e9ecef;
    color: #495057;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* User Management Specific Styles */
.custom-admin-table thead th {
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    border-bottom-width: 1px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.custom-admin-table tbody td {
    padding-top: 16px;
    padding-bottom: 16px;
    border-bottom-color: #f1f3f5;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
}

/* Footer Styles */
.footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0;
    z-index: 100;
    transition: left 0.3s;
}

.is-logged-in .footer-bar {
    left: var(--sidebar-width);
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

@media (max-width: 768px) {
    .is-logged-in .footer-bar {
        left: 0 !important;
    }
}

/* Error Pages Styles */
.error-container {
    max-width: 500px;
    width: 100%;
    padding: 20px;
}

.error-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 3rem 2rem;
    text-align: center;
}

.error-icon {
    font-size: 5rem;
    color: #dc3545;
    margin-bottom: 1.5rem;
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.error-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
}

.error-message {
    color: #718096;
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-logo {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Preview Page Styles */
.preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    background-color: #333;
}

.preview-content {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background-color: white;
    border-radius: 4px;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.file-info-bar {
    background: white;
    padding: 10px 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Public Viewer Specific Styles */
.viewer-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    color: #fff;
}

.viewer-header {
    background: #2a2a2a;
    padding: 1rem;
    border-bottom: 1px solid #3a3a3a;
}

.viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: auto;
}

.viewer-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.viewer-content iframe {
    width: 100%;
    height: 85vh;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.btn-back {
    background: #3a3a3a;
    color: #fff;
    border: none;
}

.btn-back:hover {
    background: #4a4a4a;
    color: #fff;
}

.btn-download-viewer {
    background: #0d6efd;
    color: #fff;
}

/* Custom GKS Confirm Modal Styles */
#gksConfirmModal .modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#gksConfirmModal .btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(255, 75, 43, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

#gksConfirmModal .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 75, 43, 0.4);
}

#gksConfirmModal .btn-light {
    border: 1px solid #eee;
}