/* ==========================================
   DNN Documents Module - Stylesheet v10.0.0
   ========================================== */

.dnn-documents-module { font-family: inherit; }

/* Admin Bar */
.dnn-documents-admin-bar {
    display: flex; gap: 8px;
    padding: 8px 0 16px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 16px;
}

/* Empty State */
.dnn-documents-empty {
    padding: 40px 20px; text-align: center;
    color: #888; background: #f9f9f9;
    border-radius: 6px; border: 1px dashed #ccc;
}

/* Category Filter Bar */
.dnn-documents-filter {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 20px; padding: 12px;
    background: #f5f5f5; border-radius: 6px;
}

.dnn-btn-filter {
    background: #fff; border: 1px solid #ccc;
    border-radius: 20px; padding: 4px 14px;
    font-size: 13px; cursor: pointer; color: #555;
    transition: all 0.15s ease;
}
.dnn-btn-filter:hover, .dnn-btn-filter.active {
    background: #337ab7; border-color: #337ab7; color: #fff;
}

/* Category heading */
.dnn-documents-category-group { margin-bottom: 28px; }
.dnn-documents-category-heading {
    font-size: 16px; font-weight: 600; color: #333;
    border-bottom: 2px solid #337ab7;
    padding-bottom: 6px; margin-bottom: 14px;
}

/* Shared item elements */
.dnn-doc-main { display: flex; align-items: flex-start; gap: 14px; flex: 1; min-width: 0; }
.dnn-doc-file-icon { color: #337ab7; flex-shrink: 0; width: 28px; text-align: center; }
.dnn-doc-info { flex: 1; min-width: 0; }
.dnn-doc-title { font-weight: 500; margin-bottom: 3px; }
.dnn-doc-title a { color: #337ab7; text-decoration: none; }
.dnn-doc-title a:hover { text-decoration: underline; color: #23527c; }
.dnn-doc-description { font-size: 13px; color: #666; margin-bottom: 4px; }
.dnn-doc-meta { font-size: 12px; color: #999; display: flex; flex-wrap: wrap; gap: 10px; }
.dnn-doc-edit-controls { display: flex; gap: 4px; flex-shrink: 0; margin-left: 12px; align-items: center; }

/* ── LIST MODE ─────────────────────────────── */
.dnn-documents-list .dnn-documents-items {
    display: flex;
    flex-direction: column;
}
.dnn-documents-list .dnn-document-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid #e8e8e8;
    border-top: none;
    background: #fff;
    transition: background 0.1s;
}
.dnn-documents-list .dnn-document-item:first-child {
    border-top: 1px solid #e8e8e8;
    border-radius: 4px 4px 0 0;
}
.dnn-documents-list .dnn-document-item:last-child { border-radius: 0 0 4px 4px; }
.dnn-documents-list .dnn-document-item:hover { background: #f7f9fc; }

/* ── GRID MODE ─────────────────────────────── */
.dnn-documents-grid .dnn-documents-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.dnn-documents-grid .dnn-document-item {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, transform 0.1s;
}
.dnn-documents-grid .dnn-document-item:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}
.dnn-documents-grid .dnn-doc-file-icon {
    font-size: 2.2em;
    margin-bottom: 12px;
    width: auto;
}
.dnn-documents-grid .dnn-doc-main { flex-direction: column; gap: 0; }
.dnn-documents-grid .dnn-doc-edit-controls { margin-left: 0; margin-top: 12px; }

/* ── TABLE MODE ────────────────────────────── */
.dnn-documents-table { width: 100%; border-collapse: collapse; }
.dnn-documents-table th {
    background: #f5f5f5; font-weight: 600; font-size: 13px;
    padding: 10px 12px; border-bottom: 2px solid #ddd; text-align: left;
}
.dnn-documents-table td {
    padding: 9px 12px; border-bottom: 1px solid #eee; vertical-align: middle;
}
.dnn-documents-table tr:hover td { background: #f7f9fc; }
.dnn-doc-icon { width: 30px; text-align: center; color: #337ab7; }
.dnn-doc-filesize { white-space: nowrap; font-size: 13px; color: #888; }
.dnn-doc-actions { white-space: nowrap; text-align: right; }

/* ── BUTTONS ───────────────────────────────── */
.dnn-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 14px; border-radius: 4px;
    border: 1px solid transparent; font-size: 14px;
    cursor: pointer; text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1.4;
}
.dnn-btn-primary { background: #337ab7; border-color: #2e6da4; color: #fff; }
.dnn-btn-primary:hover { background: #286090; color: #fff; text-decoration: none; }
.dnn-btn-default { background: #fff; border-color: #ccc; color: #333; }
.dnn-btn-default:hover { background: #f4f4f4; color: #333; text-decoration: none; }
.dnn-btn-danger  { background: #d9534f; border-color: #c9302c; color: #fff; }
.dnn-btn-danger:hover  { background: #c9302c; color: #fff; text-decoration: none; }
.dnn-btn-sm { padding: 5px 10px; font-size: 13px; }
.dnn-btn-xs { padding: 3px 7px; font-size: 12px; }

/* ── FORMS ─────────────────────────────────── */
.dnn-documents-edit, .dnn-documents-settings { max-width: 700px; }
.dnn-form-item { margin-bottom: 16px; }
.dnn-form-item-check { margin-bottom: 10px; }
.dnn-form-item-check label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: normal; }
.dnn-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; color: #444; }
.dnn-form-control {
    width: 100%; padding: 7px 10px; border: 1px solid #ccc;
    border-radius: 4px; font-size: 14px; color: #333;
    box-sizing: border-box; transition: border-color 0.15s;
}
.dnn-form-control:focus { border-color: #337ab7; outline: none; box-shadow: 0 0 0 2px rgba(51,122,183,0.2); }
.dnn-form-hint { display: block; font-size: 12px; color: #999; margin-top: 4px; }
.dnn-required { color: #d9534f; margin-left: 2px; }
.dnn-form-actions { padding-top: 16px; border-top: 1px solid #eee; margin-top: 20px; display: flex; gap: 10px; }
.dnn-form-errors { background: #fdf2f2; border: 1px solid #f5c6cb; border-radius: 4px; padding: 10px 14px; margin-bottom: 16px; color: #721c24; font-size: 13px; }
.dnn-doc-source-tabs { display: flex; gap: 16px; margin-bottom: 10px; font-size: 14px; }
.dnn-doc-source-panel { padding: 12px; background: #f9f9f9; border: 1px solid #e0e0e0; border-radius: 4px; }
.dnn-file-picker-wrapper { display: flex; gap: 8px; }
.dnn-file-picker-wrapper .dnn-form-control { flex: 1; }
fieldset { border: 1px solid #ddd; border-radius: 6px; padding: 16px 20px; margin-bottom: 20px; }
legend { font-weight: 600; font-size: 14px; color: #337ab7; padding: 0 8px; width: auto; border: none; margin-bottom: 0; }

/* Responsive */
@media (max-width: 600px) {
    .dnn-documents-grid .dnn-documents-items { grid-template-columns: 1fr; }
    .dnn-doc-edit-controls { display: none; }
    .dnn-documents-admin-bar { flex-wrap: wrap; }
}

/* ── Search + Filter toolbar ────────────────────────────── */
.dnn-documents-search-wrap {
    margin-bottom: 10px;
}

.dnn-documents-search {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 360px;
}

.dnn-search-icon {
    position: absolute;
    left: 10px;
    color: #999;
    font-size: 13px;
    pointer-events: none;
}

/* Bootstrap form-control style */
.dnn-documents-module .dnn-documents-search-input {
    display: block !important;
    width: 100% !important;
    height: 34px !important;
    padding: 6px 32px 6px 30px !important;
    font-size: 14px !important;
    line-height: 1.42857143 !important;
    color: #555 !important;
    background-color: #fff !important;
    background-image: none !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075) !important;
    transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
    box-sizing: border-box !important;
    outline: none !important;
    -webkit-appearance: none !important;
}

.dnn-documents-module .dnn-documents-search-input:focus {
    border-color: #66afe9 !important;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(102,175,233,0.6) !important;
}

.dnn-documents-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}

.dnn-documents-search-clear:hover { color: #555; }

.dnn-documents-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 20px;
}

/* ── Edit/delete controls: admin only ─────────────────── */
.dnn-doc-edit-controls { display: none; }
.dnn-is-admin .dnn-doc-edit-controls { display: flex; }

/* Also hide table action column for non-admins */
.dnn-doc-actions { display: none; }
.dnn-is-admin .dnn-doc-actions { display: table-cell; }
