/*
 * Upload widget (public/js/uploader.js), styled after the Bootstrap
 * "explorer" file input the site used before. Bootstrap 3 classes
 * (input-group, btn, progress) are used for the parts they cover.
 *
 *   .cwdms-uploader                 the widget
 *     .cwdms-uploader-preview       bordered box (drop-zone mode)
 *       .cwdms-uploader-drop        dashed drop zone; .is-dragover while dragging
 *         .cwdms-uploader-empty     title shown before any file is added
 *         .cwdms-uploader-list      file rows
 *     .cwdms-uploader-caption       summary + choose button (drop-zone mode)
 *   .cwdms-uploader-file            one file; .is-uploading / .is-done / .is-failed
 *   .cwdms-uploader-compact         smaller rows (button-only mode)
 */

.cwdms-uploader { margin-bottom: 10px; }

/* Bordered box around the drop zone */
.cwdms-uploader-preview {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px;
    margin-bottom: 5px;
}

/* Dashed drop zone */
.cwdms-uploader-drop {
    border: 1px dashed #aaa;
    border-radius: 4px;
    padding: 5px;
    min-height: 120px;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.cwdms-uploader-drop:hover { border: 1px dashed #999; }
.cwdms-uploader-drop.is-dragover {
    border: 2px dashed #337ab7;
    background-color: #eef5fc;
    padding: 4px;   /* keep the size when the border gets thicker */
}
.cwdms-uploader-drop.has-files { cursor: default; }

/* Title before any file is added */
.cwdms-uploader-empty {
    text-align: center;
    color: #aaa;
    padding: 40px 10px;
}
.cwdms-uploader-empty .glyphicon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
    color: #bbb;
}
.cwdms-uploader-empty-title { font-size: 1.6em; }
.cwdms-uploader-empty-hint { font-size: 12px; margin-top: 8px; color: #999; }
.cwdms-uploader-drop.has-files .cwdms-uploader-empty { display: none; }

/* File rows, like the explorer theme's table */
.cwdms-uploader-list { margin: 0; }
.cwdms-uploader-file {
    display: flex;
    align-items: center;
    padding: 6px 4px;
    border-top: 1px solid #eee;
}
.cwdms-uploader-file:first-child { border-top: 0; }
.cwdms-uploader-thumb {
    flex: none;
    width: 80px;
    height: 80px;
    padding: 5px;
    margin-right: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #999;
    font-size: 30px;
}
.cwdms-uploader-thumb img { max-width: 100%; max-height: 100%; }
.cwdms-uploader-info { flex: 1; min-width: 0; }
.cwdms-uploader-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cwdms-uploader-meta { color: #777; font-size: 12px; }
.cwdms-uploader-progress.progress {
    height: 13px;
    margin: 5px 0 0;
}
.cwdms-uploader-progress .progress-bar {
    font-size: 11px;
    line-height: 13px;
    min-width: 2em;
}
.cwdms-uploader-error { color: #a94442; font-size: 12px; margin-top: 4px; }
.cwdms-uploader-status {
    flex: none;
    width: 40px;
    text-align: center;
    font-size: 18px;
}
.cwdms-uploader-file.is-uploading .cwdms-uploader-status { color: #31708f; }
.cwdms-uploader-file.is-done .cwdms-uploader-status { color: #3c763d; }
.cwdms-uploader-file.is-failed .cwdms-uploader-status { color: #a94442; }
.cwdms-uploader-file.is-failed .cwdms-uploader-progress { display: none; }
.cwdms-uploader-file.is-failed .cwdms-uploader-thumb { border-color: #ebccd1; background: #f2dede; }

/* Caption bar under the box: summary and choose button */
.cwdms-uploader-caption .form-control {
    color: #777;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #fff;
    cursor: default;
}
.cwdms-uploader-caption .form-control .glyphicon { margin-right: 6px; }

/* Button-only mode: smaller rows under the button */
.cwdms-uploader-compact .cwdms-uploader-list { margin-top: 8px; }
.cwdms-uploader-compact .cwdms-uploader-thumb { width: 44px; height: 44px; font-size: 18px; padding: 3px; }
.cwdms-uploader-compact .cwdms-uploader-status { width: 30px; font-size: 14px; }

/* Spinner for the "uploading" status icon */
@keyframes cwdms-uploader-spin { to { transform: rotate(360deg); } }
.cwdms-uploader-spin { display: inline-block; animation: cwdms-uploader-spin 1s linear infinite; }
