:root {
    --primary-color: #0056b3;
    /* Medical Blue */
    --secondary-color: #0288d1;
    /* Lighter Blue */
    --accent-color: #00c853;
    /* Success Green */
    --bg-color: #f4f7fa;
    --sidebar-bg: #ffffff;
    --text-main: #333333;
    --text-light: #757575;
    --border-color: #e0e0e0;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    max-width: 60px;
    height: auto;
    margin-bottom: 10px;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 700;
}

.sidebar-header p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: background 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: #e3f2fd;
    color: var(--primary-color);
}

.sidebar-nav a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.nav-header {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-left: 15px;
    pointer-events: none;
}

.folder-list {
    margin-left: 10px;
}

.sidebar-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    background-color: #fff;
    padding: 15px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breadcrumbs {
    font-size: 0.95rem;
    color: var(--text-light);
}

.breadcrumbs a {
    color: var(--text-main);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.separator {
    margin: 0 8px;
    color: #ccc;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 15px 8px 35px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 250px;
    font-size: 0.9rem;
    transition: width 0.3s;
}

.search-box input:focus {
    width: 300px;
    outline: none;
    border-color: var(--primary-color);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.section-header {
    margin-bottom: 30px;
}

.section-header h1 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-light);
}

.back-link {
    margin-bottom: 20px;
}

.back-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.back-link a i {
    margin-right: 5px;
}

/* Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: #e3f2fd;
}

.icon-box {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.folder-icon {
    color: #ffca28;
}

.file-icon.pdf {
    color: #f44336;
}

.file-icon.image {
    color: #4caf50;
}

.file-icon.doc {
    color: #2196f3;
}

.file-icon.xls {
    color: #4caf50;
}

.card-info h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 5px;
    word-break: break-word;
    line-height: 1.4;
}

.meta {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    justify-content: center;
    gap: 10px;
}

.preview-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    color: var(--text-light);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card:hover .preview-btn {
    opacity: 1;
}

.preview-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.empty-state {
    text-align: center;
    padding: 50px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 2% auto;
    width: 90%;
    height: 90%;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    background: #f5f5f5;
}

.modal-body iframe,
.modal-body img {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .main-content {
        height: auto;
    }

    .search-box input {
        width: 150px;
    }
}