/* Files Gallery - Main Application Styles */

/* Import Glass Morphism Design */
@import './glass-morphism.css';

/* Import Layout Styles */
@import './layouts.css';

/* Import Component Styles */
@import './components/topbar.css';
@import './components/sidebar.css';
@import './components/main-content.css';
@import './components/overlays.css';
@import './components/files-grid.css';
@import './components/folder-tree.css';

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    overflow: hidden;
    color: white;
}

/* Main Container */
.fg-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 20px;
    gap: 0;
}

/* Main Layout */
.fg-main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    gap: 0;
    height: calc(100vh - var(--topbar-height) - 40px);
}

/* Breadcrumb Row Layout */
.fg-breadcrumb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.fg-breadcrumb-nav {
    flex: 0 0 auto;
}

.fg-breadcrumb-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.fg-folder-actions {
    display: flex;
    gap: 5px;
}

.fg-content-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
}

/* Layout Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.button-icon {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
}

.button-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.svg-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px;
    min-width: 200px;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.dropdown-header {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.dropdown-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-item.active {
    background: rgba(59, 130, 246, 0.3);
}

.fg-topbar-search {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 200px;
}

.fg-topbar-search input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 14px;
    width: 100%;
}

.fg-topbar-search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.fg-topbar-search i {
    color: rgba(255, 255, 255, 0.6);
    margin-left: 8px;
}

/* Topbar Container */
.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* Topbar Right Section */
.fg-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fg-topbar-right > div {
    display: flex;
    align-items: center;
}

.fg-topbar-right > button,
.fg-topbar-right > div:not(.fg-topbar-user) {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fg-topbar-right > div:not(.fg-topbar-actions):hover {
    background: rgba(255, 255, 255, 0.2);
}

.fg-topbar-right .button-icon {
    background: transparent;
    border: none;
    padding: 0;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fg-topbar-right .svg-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.container > div {
    display: flex;
    align-items: center;
    justify-content: center;
}

.container > div:not(.fg-topbar-search) {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    min-width: 40px;
    height: 40px;
    position: relative;
}

.container > div:not(.fg-topbar-search):hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Layout dropdown inside container */
.container .dropdown {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
}

.container .button-icon {
    background: transparent;
    border: none;
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Disable hover trigger for dropdowns, use click only */
.dropdown.mouse-hover .dropdown-menu {
    display: none !important;
}

.dropdown .dropdown-menu[style*="display: block"] {
    display: block !important;
}

/* Loading Spinner */
.fg-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    border-radius: var(--border-radius);
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 330px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
        --topbar-height: 60px;
    }
    
    .fg-topbar {
        margin: 10px;
        border-radius: var(--border-radius);
    }
    
    .fg-main-layout {
        flex-direction: column;
    }
    
    .fg-sidebar {
        position: fixed;
        left: -100%;
        top: calc(var(--topbar-height) + 20px);
        width: 280px;
        height: calc(100vh - var(--topbar-height) - 40px);
        transition: left 0.3s ease;
        z-index: 1000;
        margin: 10px;
        border-radius: var(--border-radius);
    }
    
    .fg-sidebar.active {
        left: 0;
    }
    
    .fg-main-content {
        margin: 10px;
        border-radius: var(--border-radius);
    }
}

/* Utility Classes */
.text-white { color: white; }
.text-gray { color: rgba(255, 255, 255, 0.7); }
.text-center { text-align: center; }
.font-bold { font-weight: 600; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

/* Selection Mode Styles */
.fg-files-container.selection-mode .file-checkbox {
    display: block !important;
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    width: 18px;
    height: 18px;
    opacity: 1;
    cursor: pointer;
}

.file-checkbox {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-item.selected {
    background: rgba(59, 130, 246, 0.2) !important;
    border: 2px solid rgba(59, 130, 246, 0.5) !important;
    transform: scale(0.98);
}

.fg-files-container.selection-mode .file-item {
    position: relative;
    cursor: pointer;
}

#select-mode-button.active {
    background: rgba(59, 130, 246, 0.3) !important;
    color: white !important;
}

.select-mode-dropdown {
    font-family: inherit !important;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Zrušit overflow hidden pro mobilní zařízení */
    body {
        overflow: auto;
        overflow-x: hidden;
    }
    
    /* Hlavní kontejner */
    .fg-container {
        height: auto;
        min-height: 100vh;
        padding: 10px;
    }
    
    /* Hlavní layout - změnit na vertikální */
    .fg-main-layout {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 80px);
    }
    
    /* Sidebar - skrýt ve výchozím stavu */
    .fg-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        overflow-y: auto;
        background: rgba(30, 32, 40, 0.98);
        backdrop-filter: blur(20px);
    }
    
    .fg-sidebar.mobile-visible {
        left: 0;
    }
    
    /* Overlay pro sidebar */
    .fg-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }
    
    .fg-sidebar-overlay.visible {
        display: block;
    }
    
    /* Hlavní obsah */
    .fg-main-content {
        width: 100%;
        height: auto;
        min-height: 400px;
        padding: 15px;
        border-radius: var(--border-radius);
    }
    
    /* Breadcrumb */
    .fg-breadcrumb {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fg-breadcrumb-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* Akce */
    .fg-content-actions {
        flex-wrap: wrap;
    }
    
    /* Tlačítko pro zobrazení/skrytí sidebaru */
    .fg-mobile-toggle {
        display: block;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: white;
        z-index: 1000;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(10px);
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .fg-container {
        padding: 5px;
    }
    
    .fg-main-content {
        padding: 10px;
    }
    
    /* Menší fonty */
    .fg-content-title {
        font-size: 18px;
    }
    
    .fg-breadcrumb-item {
        font-size: 12px;
    }
}