/* =========================================================
   File Manager — filemanager.css
   Joomla 4.3.4 yönetici paneli uyumlu stiller
   ========================================================= */

/* Layout */
.fm-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    color: #3d3d3d;
    padding: 0 0 2rem;
}

.fm-layout {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* ---- Breadcrumb ---- */
.fm-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 0;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
}
.fm-breadcrumb a {
    color: #2a69b8;
    text-decoration: none;
}
.fm-breadcrumb a:hover { text-decoration: underline; }
.fm-sep { color: #aaa; }

/* ---- Sol Panel ---- */
.fm-sidebar {
    width: 220px;
    flex-shrink: 0;
}

.fm-sidebar-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.fm-tree {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

.fm-tree-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 6px;
    color: #444;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
}
.fm-tree-link:hover { background: #f0f4f9; color: #2a69b8; }
.fm-tree-link.active {
    background: #e8f0fb;
    color: #1a56b8;
    font-weight: 500;
}

/* Yeni Klasör */
.fm-new-folder h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin: 0 0 8px;
}

.fm-field-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fm-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ccd;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.fm-input:focus {
    outline: none;
    border-color: #2a69b8;
    box-shadow: 0 0 0 3px rgba(42,105,184,0.12);
}

/* ---- Ana Panel ---- */
.fm-main { flex: 1; min-width: 0; }

/* ---- Yükleme Alanı ---- */
.fm-dropzone {
    border: 2px dashed #c0cfe8;
    border-radius: 10px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 1.25rem;
    background: #fafcff;
}
.fm-dropzone:hover,
.fm-dropzone.fm-drag-over {
    border-color: #2a69b8;
    background: #f0f5ff;
}

.fm-drop-icon { margin-bottom: 10px; }
.fm-drop-icon .icon-upload {
    font-size: 32px;
    color: #2a69b8;
    opacity: 0.7;
}

.fm-drop-title {
    font-weight: 600;
    font-size: 15px;
    margin: 0 0 4px;
    color: #333;
}

.fm-drop-sub {
    font-size: 12px;
    color: #888;
    margin: 0 0 2px;
}

.fm-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 12px;
    cursor: pointer;
}

.fm-file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

/* İlerleme Çubuğu */
.fm-progress-wrap {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.fm-progress-bar {
    flex: 1;
    height: 6px;
    background: #e8eef7;
    border-radius: 3px;
    overflow: hidden;
}
.fm-progress-fill {
    height: 100%;
    width: 0%;
    background: #2a69b8;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.fm-progress-label {
    font-size: 12px;
    color: #666;
    min-width: 36px;
    text-align: right;
}

/* ---- Araç Çubuğu ---- */
.fm-file-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.fm-count { font-size: 13px; color: #666; }

.fm-file-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Tür Filtresi */
.fm-filter-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.fm-type-btn {
    font-size: 11px;
    padding: 4px 9px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f5f5f5;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
}
.fm-type-btn:hover { border-color: #2a69b8; color: #2a69b8; }
.fm-type-btn.active {
    background: #2a69b8;
    border-color: #2a69b8;
    color: #fff;
}

/* Arama */
.fm-search {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    width: 180px;
    color: #333;
    background: #fff;
}
.fm-search:focus { outline: none; border-color: #2a69b8; }

/* Görünüm Düğmeleri */
.fm-view-btn {
    padding: 5px 9px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #666;
    cursor: pointer;
}
.fm-view-btn.active,
.fm-view-btn:hover { border-color: #2a69b8; color: #2a69b8; background: #f0f5ff; }

/* Toplu İşlemler */
.fm-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #795548;
}

/* ---- Dosya Izgarası ---- */
.fm-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

/* Liste görünümü */
.fm-file-grid.fm-view-list {
    grid-template-columns: 1fr;
}
.fm-file-grid.fm-view-list .fm-file-card {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
}
.fm-file-grid.fm-view-list .fm-thumb {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.fm-file-grid.fm-view-list .fm-file-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fm-file-card {
    position: relative;
    border: 1.5px solid #e8eaf0;
    border-radius: 10px;
    padding: 10px 8px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.fm-file-card:hover {
    border-color: #2a69b8;
    box-shadow: 0 2px 8px rgba(42,105,184,0.1);
}
.fm-file-card.fm-selected {
    border-color: #2a69b8;
    background: #eef4ff;
}

.fm-file-check {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2a69b8;
}

/* Küçük Resim */
.fm-thumb {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    overflow: hidden;
}

.fm-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.fm-thumb-svg {
    object-fit: contain;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 0 0 / 12px 12px;
}

.fm-thumb-icon {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Uzantıya göre renk */
.fm-ext-php  { background: #fff3e0; }
.fm-ext-php .icon-code { font-size: 28px; color: #e65100; }

.fm-ext-jpg,
.fm-ext-jpeg { background: #e3f2fd; }
.fm-ext-jpg .icon-picture,
.fm-ext-jpeg .icon-picture { font-size: 28px; color: #1565c0; }

.fm-ext-png  { background: #e8f5e9; }
.fm-ext-png .icon-picture { font-size: 28px; color: #2e7d32; }

.fm-ext-gif  { background: #fce4ec; }
.fm-ext-gif .icon-picture { font-size: 28px; color: #880e4f; }

.fm-ext-svg  { background: #f3e5f5; }
.fm-ext-svg .icon-paint-brush { font-size: 28px; color: #6a1b9a; }

.fm-ext-webp { background: #e0f7fa; }
.fm-ext-webp .icon-picture { font-size: 28px; color: #00695c; }

.fm-ext-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #555;
    text-transform: uppercase;
}

/* Dosya Bilgisi */
.fm-file-info {
    width: 100%;
    text-align: center;
}

.fm-file-name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.fm-file-meta {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Boş Durum */
.fm-empty {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}
.fm-empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }

/* ---- Modal ---- */
.fm-modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 380px;
    max-width: 95vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.fm-modal h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #222;
}

.fm-field { margin-bottom: 16px; }
.fm-field label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
}

.fm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* ---- Butonlar ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
    background: #2a69b8;
    border-color: #2a69b8;
    color: #fff;
}
.btn-primary:hover { background: #1a56a0; border-color: #1a56a0; }

.btn-secondary {
    background: #f5f5f5;
    border-color: #ddd;
    color: #444;
}
.btn-secondary:hover { background: #eaeaea; }

.btn-danger {
    background: #fff;
    border-color: #e57373;
    color: #c62828;
}
.btn-danger:hover { background: #ffebee; }

.btn-small { padding: 5px 11px; font-size: 12px; }

/* ---- Bildirim (toast) ---- */
.fm-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: fmToastIn 0.2s ease;
}
.fm-toast-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.fm-toast-error   { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

@keyframes fmToastIn {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

/* ---- Duyarlı ---- */
@media (max-width: 768px) {
    .fm-layout { flex-direction: column; }
    .fm-sidebar { width: 100%; }
    .fm-file-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}
