//
// Simple List
// --------------------------------------------------
// Usage (bullets):
//   <div class="control-simplelist">
//       <ul>
//           <li>Hello friend</li>
//       </ul>
//   </div>
//
// With icons (no bullets):
//   <div class="control-simplelist with-icons">
//       <ul>
//           <li class="oc-icon-check">Hello friend</li>
//       </ul>
//   </div>
//
// With checkboxes:
//   <div class="control-simplelist with-checkboxes">
//       <ul>
//           <li>
//               <div class="checkbox custom-checkbox">
//                   <input id="checkbox-example1" name="checkbox" value="1" type="checkbox">
//                   <label class="choice" for="checkbox-example1"> Dodge Viper</label>
//               </div>
//           </li>
//       </ul>
//   </div>
//
// Divided (basic):
//   <div class="control-simplelist is-divided">
//       <ul>
//           <li>Hello friend</li>
//       </ul>
//   </div>
//
// Selectable:
//   <div class="control-simplelist is-selectable">
//       <ul>
//           <li>
//               <a href="#">
//                   <h5 class="heading">Hello friend</h5>
//                   <p class="description">Something cool over here</p>
//               </a>
//           </li>
//       </ul>
//   </div>
//
// Selectable (box):
//   <div class="control-simplelist is-selectable-box">
//       <ul>
//           <li>
//               <a href="#">
//                   <div class="box">
//                       <div class="image"><i class="icon-user"></i></div>
//                   </div>
//                   <h5 class="heading">Hello friend</h5>
//                   <p class="description">Something cool over here</p>
//               </a>
//           </li>
//       </ul>
//   </div>
//

.control-simplelist {
    font-size: 13px;
    padding: 20px 20px 2px 20px;
    margin-bottom: @padding-standard;
    background: @color-form-checkboxlist-background;
    .border-radius(@border-radius-base);

    ul { padding-left: 15px; }

    &.form-control {
        ul { margin-bottom: 0; }
        li {
            padding-top: 5px;
            padding-bottom: 5px;
        }
    }

    &.with-icons,
    &.with-checkboxes,
    &.is-divided,
    &.is-selectable {
        ul {
            list-style-type: none;
            padding-left: 0;
        }
    }

    &.with-checkboxes {
        li {
            margin-top: -5px;

            &:first-child {
                margin-top: 0;
            }

            &:last-child {
                div.custom-checkbox {
                    margin-bottom: 0;

                    label {
                        margin-bottom: 5px;
                    }
                }
            }
        }
    }

    &.is-sortable {

        li.placeholder {
            position: relative;
            &:before {
                top: -10px;
                position: absolute;
                .triangle(right, 5px, 9px, @color-sortable-caret);
            }
        }

        li.dragged {
            position: absolute;
            .opacity(.5);
            z-index: 2000;
            color: @color-sortable-active;

            width: auto !important; // Prevent browser scrollbars
        }
    }

    &.is-scrollable {
        height: 200px;
        &.size-tiny { min-height: @size-tiny + 200; }
        &.size-small { min-height: @size-small + 200; }
        &.size-large { min-height: @size-large + 200; }
        &.size-huge { min-height: @size-huge + 200; }
        &.size-giant { min-height: @size-giant + 200; }
    }

    &.is-divided,
    &.is-selectable,
    &.is-selectable-box {
        padding: 0;

        li {
            .heading {
                font-size: 14px;
                font-weight: 500;
            }

            .description {}
        }
    }

    &.is-divided,
    &.is-selectable {
        li {
            padding: 5px 10px;
            border-bottom: 1px solid @color-list-border;

            &:last-child {
                border-bottom: none;
            }
        }
    }

    &.is-selectable {
        li {
            a {
                padding: 5px 10px;
                margin: -5px -10px;
                display: block;
                color: @text-color;
            }
            &:hover {
                background: @color-list-hover-bg;
                cursor: pointer;
                &, a { color: white; }
                a { text-decoration: none; }
            }

            &.active {
                a {
                    background: #f0f0f0;
                    &:hover {
                        background: @color-list-hover-bg;
                    }
                }
            }
        }
    }

    &.is-selectable-box {
        padding-top: 15px;
        margin-bottom: 0;

        li {
            width: 155px;
            margin: 8px;
            display: inline-block;
            text-align: center;
            vertical-align: top;

            a {
                text-decoration: none;
                display: block;
                color: @text-color;

                .box {
                    display: block;
                    width: 155px;
                    height: 155px;
                    border: 3px solid rgba(0,0,0,.1);
                    position: relative;
                    .transition(border .3s ease);
                }

                .image {
                    display: block;
                    width: 56px;
                    height: 56px;
                    position: absolute;
                    top: 50%;
                    left: 50%;
                    margin-top: -28px;
                    margin-left: -28px;

                    > i {
                        font-size: 56px;
                        color: rgba(0,0,0,.25);
                    }
                }

                .heading {
                    margin: 7px 0;
                    padding: 0;
                }

                .description {
                    font-size: 12px;
                }

                &:hover {
                    .box {
                        border-color: rgba(0,0,0,.2);
                    }

                    .image > i {
                        color: rgba(0,0,0,.45);
                    }
                }
            }
        }
    }
}

.list-preview .control-simplelist {
    &.is-selectable {
        ul {
            margin-bottom: 0;
        }
    }
}
