/* Layout */
.milan-file-manager-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 20px 0;
}

/* Sidebar */
.milan-file-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #f8faf9;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    position: sticky;
    top: 20px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
}

.sidebar-header {
    background: #edf1ef;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #3d4a43;
    font-weight: 700;
}

.milan-category-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-item {
    border-bottom: 1px solid #edf1ef;
}

.category-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #4b5563;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    position: relative;
}

.category-link:hover {
    background: #f0f4f2;
    color: #3d4a43;
}

.category-item.active > .category-link {
    background: #7c8e84;
    color: white;
}

.file-count {
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.7;
}

.submenu-toggle {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    margin-right: 8px;
    font-size: 0.8rem;
    color: #94a39b;
    transition: transform 0.2s;
}

.category-item.open > .category-link .submenu-toggle {
    transform: rotate(90deg);
}

.submenu {
    background: #ffffff;
    padding-left: 0;
}

.category-item.depth-1 .category-link { padding-left: 32px; }
.category-item.depth-2 .category-link { padding-left: 48px; }

.category-item.depth-0 > .category-link {
    font-size: 1.1rem;
    font-weight: 700;
    color: #3d4a43;
}

/* Main Content */
.milan-file-content {
    flex-grow: 1;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    /* overflow: hidden; - REMOVED to allow zoomed thumbnails to pop out */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
}

.content-header {
    background: #f9fafb;
    padding: 20px 24px;
    border-bottom: 2px solid #edf1ef;
    position: relative;
    z-index: 10; /* Zůstane nad běžnými řádky */
}

.content-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #3d4a43;
    font-weight: 700;
}

/* Responsivita */
@media (max-width: 991px) {
    .milan-file-manager-layout {
        flex-direction: column;
    }

    .milan-file-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }
}

/* Řádky se soubory */
.file-row {
    border-bottom: 1px solid #edf1ef;
    background: #ffffff;
    position: relative;
    z-index: 1;
}

.file-row.alt-bg {
    background: #f8faf9;
}

.file-row:hover {
    background: #f0f4f2;
    z-index: 100; /* Zvýšení na hover pro náhled */
}

.file-row td {
    padding: 14px 16px;
    color: #47554f;
    font-size: 0.9rem;
    vertical-align: top;
}

/* Nadpis souboru s náhledem */
.file-title-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.file-thumbnail {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: visible; /* Aby se zoom schoval jen uvnitř bez ořezu? Ne, chceme to přes. */
    position: relative;
    background: #f1f4f2;
    border: 1px solid #edf1ef;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: block;
}

.file-thumbnail:hover img {
    transform: scale(6); /* Větší zvětšení pro detail */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    position: relative;
    border-radius: 2px;
}

.file-thumbnail.fallback-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #edf1ef;
    font-size: 1.2rem;
    cursor: default;
    z-index: 10;
}

.file-thumbnail.fallback-icon span {
    transition: transform 0.3s ease;
}

.file-thumbnail.fallback-icon:hover span {
    transform: scale(2);
    z-index: 9999;
}

.file-name-meta {
    display: flex;
    flex-direction: column;
}

/* Zobrazení URL pod nadpisem */
.file-url-display {
    font-size: 0.75rem;
    margin-top: 4px;
}

.file-url-display a {
    color: #7c8e84 !important;
    text-decoration: underline !important;
    word-break: break-all;
    opacity: 0.9;
}

.file-url-display a:hover {
    color: #3d4a43 !important;
    opacity: 1;
}

/* Štítky typu souboru */
.file-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.type-pdf { background: #fcebeb; color: #991b1b; }
.type-image { background: #edf4f1; color: #3d4a43; }
.type-link { background: #ebf1fc; color: #1e40af; }

/* Poznámka u souboru */
.file-note {
    font-size: 0.85rem;
    color: #5d6d64;
    line-height: 1.4;
}

.milan-file-table small {
    display: block;
    color: #94a39b;
    font-size: 0.7rem;
    margin-top: 4px;
}

/* Download tlačítko */
.download-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: #7c8e84; /* Zelenošedá */
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background-color: #6a7a71;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
