////////////////////////////////////////////////////////////////////////////////
//
//  Licensed to the Apache Software Foundation (ASF) under one or more
//  contributor license agreements.  See the NOTICE file distributed with
//  this work for additional information regarding copyright ownership.
//  The ASF licenses this file to You under the Apache License, Version 2.0
//  (the "License") you may not use this file except in compliance with
//  the License.  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////

// @namespace j "library://ns.apache.org/royale/jewel"
@namespace "http://www.w3.org/1999/xhtml"
@namespace todomvc "jewel.todomvc.views.*"

// Add Controller and Model beads to TodoListSectionComponent
todomvc|TodoListSection
    IBeadController: ClassReference("jewel.todomvc.controllers.TodoController")
    IBeadModel: ClassReference("jewel.todomvc.models.TodoModel")

// Application
.jewel.application 
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif
    font-size: 14px
    font-weight: 300
    color: #4d4d4d
    line-height: 1.4em
    background: #f5f5f5
    min-width: 230px
    max-width: 550px
    margin: 0 auto
    -webkit-font-smoothing: antialiased
    -moz-osx-font-smoothing: grayscale


// Main Section
.todoapp 
    background: #fff
    margin: 130px 0 40px 0
    position: relative
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1)


// Main Title
.todoapp h1 
    position: absolute
    top: -155px
    width: 100%
    font-size: 100px
    font-weight: 100
    color: rgba(175, 47, 47, 0.15)
    text-align: center
    text-rendering: optimizeLegibility
    margin: 0.83em 0


// Button
.jewel.button 
    margin: 3px
    padding: 3px 7px
    background: none
    border: 1px solid transparent
    box-shadow: none
    border-radius: 0.25rem
    color: #808080
    font-weight: normal
    text-shadow: none
    text-transform: initial

    &:hover, &:hover:focus 
        background: none
        border: 1px solid transparent

    &:active, &:active:focus 
        background: none
        border: 1px solid transparent
        box-shadow: none

    &:focus 
        border: 1px solid transparent
        box-shadow: none

    // Clear Completed Button
    &.clear-completed 
        text-decoration: underline


// ToggleButton
.jewel.togglebutton 
    margin: 3px
    padding: 3px 7px
    background: none
    border: 1px solid transparent
    box-shadow: none
    border-radius: 0.25rem
    color: #808080
    font-weight: normal
    text-shadow: none
    text-transform: initial

    &:hover, &:hover:focus 
        background: none
        border: 1px solid rgba(175, 47, 47, .1)

    &:active, &:active:focus 
        background: none
        border: 1px solid rgba(175,47,47,.2)
        box-shadow: none

    &:focus 
        border: 1px solid #b3b3b3
        box-shadow: none

    &.selected 
        background: none
        border: 1px solid rgba(175,47,47,.2)
        box-shadow: none

    // Toggle All Button
    &.toggleAll 
        .fonticon 
            font-size: 1.8em

        &:hover, &:hover:focus 
            border: 1px solid transparent

        &:active, &:active:focus 
            border: 1px solid transparent

        &:focus 
            border: 1px solid transparent

        &.selected 
            border: 1px solid transparent

        & .fonticon 
            color: #e6e6e6

        &.selected .fonticon 
            color: #737373


// TextInput
.jewel.textinput 
    input 
        background: none
        border-radius: 0px
        padding: 12px
        font-size: 24px
        font-family: inherit
        font-weight: 300
        line-height: 1.4em
        color: inherit
        outline: 0
        border: 1px solid #999
        box-shadow: inset 0 -1px 5px 0 rgba(0,0,0,.2)
        -webkit-font-smoothing: antialiased
        -moz-font-smoothing: antialiased

        &:focus 
            border: 1px solid darkgrey

    &.new-todo 
        input 
            padding: 16px 16px 16px 60px !important
            border-radius: 0px
            border: none
            border: 0

            background: rgba(0, 0, 0, 0.003)
            box-shadow: inset 0 -2px 1px rgba(0,0,0,0.03)

            font-size: 24px
            font-family: "Helvetica Neue", Helvetica, Arial, sans-serif
            font-weight: 300
            font-stretch: normal
            font-style: normal
            font-variant-caps: normal
            line-height: 1.4em
            color: rgb(77, 77, 77)
            -webkit-font-smoothing: antialiased
            -moz-osx-font-smoothing: grayscale

            &:focus 
                border: none

            &::placeholder, &:-ms-input-placeholder 
                color:rgb(230, 230, 230)
                font-style: italic

// Data Container
.todo-list 
    IItemRenderer: ClassReference("jewel.todomvc.renderers.TodoItemRenderer")

// ItemRenderer
.todo-list li 
    font-size: 24px
    border-bottom: 1px solid #ededed

    &:last-child 
        border-bottom: none

    &.editing 
        border-bottom: none

// ItemRenderer TextInput
.jewel.item
    .jewel.textinput 
        margin-left: 46px

// ItemRenderer CheckBox
.jewel.checkbox 
    margin: 8px

    & input + span::before 
        background: url("data:image/svg+xml,%3Csvg viewBox='0 -18 100 135' xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='50' cy='50' r='50' fill='none' stroke='%23ededed' stroke-width='3'/%3E%3C/svg%3E") no-repeat center center
        border: none
        border-radius: 50%

    & input + span::after 
        background: url("data:image/svg+xml,%3Csvg viewBox='0 -18 100 135' xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='50' cy='50' r='50' fill='none' stroke='%23bddad5' stroke-width='3'/%3E%3Cpath fill='%235dc2af' d='M72 25L42 71 27 56l-4 4 20 20 34-52z'/%3E%3C/svg%3E") no-repeat center center
        border: none
        transition: none
        transform: none

    & input:checked + span::after, & input:checked:active + span::after 
        transform: none

    & input:focus + span::before, & input:checked:focus + span::before, & input:checked:active:focus + span::before 
        background: none
        border: none
        border-radius: 50%

    & span 
        padding-left: 3px
        font-size: 16px

// ItemRenderer Label complete
.completed 
    color: #d9d9d9
    text-decoration: line-through

// ItemRenderer IconButton destroy
.destroy 
    color: #af5b5e !important


// Footer
.footer 
    padding: 10px 15px
    color: #777
    text-align: center
    border-top: 1px solid #e6e6e6

    &:before 
        content: ''
        position: absolute
        right: 0
        bottom: 0
        left: 0
        height: 50px
        overflow: hidden
        box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 8px 0 -3px #f6f6f6, 0 9px 1px -3px rgba(0, 0, 0, 0.2), 0 16px 0 -6px #f6f6f6, 0 17px 2px -6px rgba(0, 0, 0, 0.2)

// Footer Info
.info 
    margin: 65px auto 0
    color: #bfbfbf
    font-size: 10px
    text-align: center
    text-shadow: 0 1px 0 rgba(255, 255, 255, .5)

    & p 
        line-height: 1

    & a 
        font-weight: 400
        color: inherit
        text-decoration: none

    & a:hover 
        text-decoration: underline
