/* MARCINCLOUD.ORG - GŁÓWNY ARKUSZ STYLÓW */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0378d4;
    --primary-dark: #0056b3;
    --danger: #dc3545;
    --success: #28a745;
    --bg-dark: #1a1a1a;
    --bg-light: #2d2d2d;
    --text-light: #ffffff;
    --text-dark: #333333;
    --border-color: #404040;
    --sidebar-width: 280px;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
}

/* Automatyczny ciemny motyw */
@media (prefers-color-scheme: light) {
    :root {
        --bg-dark: #f5f5f5;
        --bg-light: #ffffff;
        --text-light: #333333;
        --text-dark: #666666;
        --border-color: #e0e0e0;
    }
}

/* Główny kontener */
.app-container {
    display: flex;
    height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-light);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.logo {
    padding: 10px 0 30px 0;
}

.logo h2 {
    font-size: 24px;
    font-weight: 600;
}

.logo span {
    color: var(--primary);
}

.nav-menu {
    flex: 1;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: background 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(3, 120, 212, 0.2);
}

.nav-menu a i {
    width: 20px;
    color: var(--primary);
}

.user-info {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.avatar {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
}

.user-details {
    margin-bottom: 15px;
}

.user-details strong {
    display: block;
    font-size: 16px;
}

.user-details small {
    color: #888;
    font-size: 12px;
}

.quota-info {
    margin: 15px 0;
}

.quota-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

.quota-used {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.quota-info small {
    font-size: 12px;
    color: #888;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: transparent;
    color: var(--danger);
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid var(--danger);
    font-size: 14px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Bar */
.top-bar {
    height: 60px;
    padding: 0 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-dark);
    border-radius: 20px;
    padding: 5px 15px;
    width: 300px;
}

.search-box i {
    color: #888;
    margin-right: 10px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-light);
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: #666;
}

.view-options {
    display: flex;
    gap: 5px;
}

.view-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn:hover,
.view-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

/* Action Bar */
.action-bar {
    padding: 15px 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #bd2130;
}

.selection-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
}

.selected-count {
    font-size: 14px;
    color: #888;
    margin-right: 10px;
}

/* Files Container */
.files-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

/* File Items */
.file-item {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-color: var(--primary);
}

.file-item.selected {
    border-color: var(--primary);
    background: rgba(3, 120, 212, 0.1);
}

.file-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.file-icon {
    font-size: 48px;
    text-align: center;
    margin: 10px 0;
    color: var(--primary);
}

.file-icon i.fa-folder {
    color: #ffd700;
}

.file-name {
    font-size: 14px;
    text-align: center;
    word-break: break-word;
    margin-bottom: 5px;
}

.file-details {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888;
}

.file-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #888;
    cursor: pointer;
    z-index: 2;
}

.file-favorite.active {
    color: #ffd700;
}

/* Widok listy */
.files-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.files-grid.list-view .file-item {
    display: grid;
    grid-template-columns: 30px 1fr 100px 150px 80px;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
}

.files-grid.list-view .file-icon {
    font-size: 20px;
    margin: 0;
    width: 30px;
}

.files-grid.list-view .file-name {
    text-align: left;
}

/* Loading */
.loading {
    text-align: center;
    padding: 50px;
    color: #888;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--bg-light);
    color: var(--text-light);
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 10px;
    min-width: 300px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s;
    border-left: 4px solid;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.info {
    border-left-color: var(--primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsywność */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .search-box {
        width: 200px;
    }
    
    .files-grid.list-view .file-item {
        grid-template-columns: 30px 1fr 80px;
    }
    
    .files-grid.list-view .file-item .file-details {
        display: none;
    }
}

/* Panel szczegółów */
.details-panel {
    width: 300px;
    background: var(--bg-light);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
}

.details-panel.hidden {
    transform: translateX(100%);
}

.details-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.details-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-light);
}

.details-header .close-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 16px;
}

.details-header .close-btn:hover {
    color: var(--text-light);
}

.details-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.details-placeholder {
    text-align: center;
    color: #888;
    padding: 40px 20px;
}

.details-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #404040;
}

.details-placeholder p {
    font-size: 14px;
    margin: 0;
}

/* Szczegóły pliku */
.file-detail-item {
    margin-bottom: 20px;
}

.file-detail-icon {
    font-size: 64px;
    text-align: center;
    margin: 20px 0;
    color: var(--primary);
}

.file-detail-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    word-break: break-word;
}

.file-detail-info {
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.file-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.file-detail-row:last-child {
    border-bottom: none;
}

.file-detail-label {
    color: #888;
}

.file-detail-value {
    color: var(--text-light);
    font-weight: 500;
}

.file-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-detail-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-light);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-light);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Folder tree */
.folder-tree {
    margin-top: 10px;
}

.folder-tree-item {
    padding: 8px 12px;
    margin: 2px 0;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-tree-item:hover {
    background: rgba(3, 120, 212, 0.1);
}

.folder-tree-item.selected {
    background: rgba(3, 120, 212, 0.2);
    border: 1px solid var(--primary);
}

.folder-tree-item i {
    color: #ffd700;
    width: 20px;
}

.folder-tree-item .folder-name {
    flex: 1;
    color: var(--text-light);
}

.folder-tree-children {
    margin-left: 20px;
}

/* Dodatkowe style dla breadcrumb */
.breadcrumb-link {
    cursor: pointer;
    color: var(--text-light);
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
}

.breadcrumb-link:hover {
    background: var(--hover-bg);
    color: var(--text-light);
    text-decoration: none;
}

/* Style dla panelu szczegółów */
.details-panel {
    width: 320px;
    background: var(--bg-light);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    transform: translateX(100%);
    z-index: 30;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.details-panel.visible {
    transform: translateX(0);
}

.details-panel.hidden {
    transform: translateX(100%);
}

.files-container.with-details {
    margin-right: 320px;
}

/* ========== MODAL ZMIANY NAZWY ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    animation: fadeIn 0.2s ease;
}

.rename-modal {
    background: var(--bg-light);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.rename-modal-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.rename-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.rename-modal-header h3 i {
    margin-right: 8px;
}

.rename-modal-body {
    padding: 24px 20px;
}

.rename-modal-body label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

.rename-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-light);
    font-size: 14px;
    transition: all 0.2s;
}

.rename-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(3, 120, 212, 0.1);
}

.rename-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-dark);
}

.rename-modal-footer .btn {
    min-width: 100px;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsywność */
@media (max-width: 768px) {
    .rename-modal {
        width: 95%;
        max-width: none;
    }
    
    .rename-modal-footer {
        flex-direction: column;
    }
    
    .rename-modal-footer .btn {
        width: 100%;
    }
}

/* Dodatkowe style dla ulubionych */
.share-size, .share-modified {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 12px;
}

.share-size i, .share-modified i {
    color: var(--primary);
    font-size: 11px;
}

.share-status.missing {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
    min-width: auto;
}

/* Hover efekty dla elementów listy */
.share-item {
    cursor: pointer;
    transition: all 0.2s;
}

.share-item:hover {
    border-color: var(--primary);
    transform: translateX(2px);
    background: var(--hover-bg);
}

/* Responsywność dla meta danych */
@media (max-width: 768px) {
    .share-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .share-size, .share-modified {
        display: inline-flex;
    }
}

/* Poprawione pozycjonowanie menu użytkownika */
.user-menu-container {
    position: relative;
}

.user-menu-container .action-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 5px;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.3);
}

/* Dostosowanie przycisku */
.user-menu-container .action-menu-btn {
    margin-bottom: 0 !important;
    background: var(--primary) !important;
}

.user-menu-container .action-menu-btn:hover {
    background: var(--primary-dark) !important;
}

/* Styl dla elementów menu */
.user-menu-container .action-item {
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    transition: background 0.2s;
}

.user-menu-container .action-item:hover {
    background: var(--hover-bg);
}

.user-menu-container .action-item i {
    width: 20px;
    color: var(--primary);
}

.user-menu-container .dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* ===== JEDNOLITE POWIADOMIENIA ===== */
.marcincloud-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #0378d4;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 20000;
    animation: notificationSlideUp 0.3s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}

.marcincloud-notification i {
    font-size: 18px;
    color: white;
    opacity: 0.9;
}

.marcincloud-notification.success {
    background: #0378d4;
}

.marcincloud-notification.error {
    background: #dc3545;
}

.marcincloud-notification.warning {
    background: #ffc107;
    color: #333;
}

.marcincloud-notification.warning i {
    color: #333;
}

@keyframes notificationSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes notificationFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* ===== PASEK POSTĘPU UPLOADU ===== */
.upload-progress-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 20000;
    border: 1px solid var(--border-color);
    animation: slideInProgress 0.3s ease;
}

.upload-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
}

.upload-progress-header i {
    color: var(--primary);
    margin-right: 8px;
}

.upload-progress-header .close-btn {
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}

.upload-progress-header .close-btn:hover {
    color: var(--danger);
}

.upload-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.upload-progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.upload-progress-filename {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-progress-filename i {
    color: var(--primary);
    margin-right: 5px;
    font-size: 10px;
}

@keyframes slideInProgress {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}