/**
 * Copyright (c) Enalean, 2018 - Present. All Rights Reserved.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */

.tlp-card {
    margin: 0 0 var(--tlp-medium-spacing);
    padding: var(--tlp-medium-spacing);
    border: 1px solid var(--tlp-neutral-normal-color);
    border-radius: var(--tlp-large-radius);
    background: var(--tlp-white-color);
    box-shadow: var(--tlp-pane-shadow);

    &:last-child {
        margin: 0;
    }
}

.tlp-card-inactive {
    background: var(--tlp-fade-background-color-darker-01);
}

.tlp-card-selectable {
    display: block;
    transition: border-color 100ms linear;
    color: var(--tlp-typo-default-text-color);
    cursor: pointer;

    &:hover,
    &:focus,
    &:focus-within {
        border-color: var(--tlp-main-color-transparent-50);
        color: var(--tlp-typo-default-text-color);
        text-decoration: none;

        &.tlp-card-inactive {
            border-color: var(--tlp-dimmed-color-transparent-50);
        }
    }
}

.tlp-pane-section-for-cards,
.tlp-pane-section-for-cards-under-tabs {
    background: var(--tlp-white-color);

    > .tlp-pane-subtitle {
        margin: var(--tlp-medium-spacing) var(--tlp-medium-spacing) 0;
    }

    &:only-child {
        border-radius: var(--tlp-large-radius);

        > .tlp-card {
            &:first-child {
                border-radius: var(--tlp-large-radius) var(--tlp-large-radius) 0 0;

                &:hover,
                &:focus {
                    border-top: 0;
                    box-shadow: none;
                }
            }

            &:last-child {
                border: 0;
                border-radius: 0 0 var(--tlp-large-radius) var(--tlp-large-radius);
            }

            &:only-child {
                border-radius: var(--tlp-large-radius);
            }
        }
    }

    &:last-child {
        border-bottom-right-radius: var(--tlp-large-radius);
        border-bottom-left-radius: var(--tlp-large-radius);
    }

    > .tlp-card {
        margin: 0;
        border: 0;
        border-bottom: 1px solid var(--tlp-neutral-light-color);
        border-radius: 0;
        box-shadow: none;

        &:last-child {
            border: 0;
            border-radius: 0 0 var(--tlp-large-radius) var(--tlp-large-radius);
        }
    }

    > .tlp-card-selectable {
        transition:
            border-color 100ms linear,
            background 100ms linear,
            box-shadow 100ms linear;

        &:hover,
        &:focus {
            border-color: var(--tlp-main-color-hover-background);
            background: var(--tlp-main-color-hover-background);
            box-shadow: 0 -1px 0 var(--tlp-main-color-hover-background);
            text-decoration: none;

            &:first-child {
                box-shadow: inset 0 1px 0 var(--tlp-main-color-hover-background);
            }
        }
    }

    > .tlp-card-inactive {
        transition:
            border-color 100ms linear,
            background 100ms linear,
            box-shadow 100ms linear;
        background: var(--tlp-fade-background-color);

        &:hover,
        &:focus {
            border-color: var(--tlp-neutral-normal-color);
            background: var(--tlp-fade-background-color-hover-border);
            box-shadow: 0 -1px 0 var(--tlp-neutral-normal-color);
        }
    }
}

.tlp-pane-section-for-cards-under-tabs {
    padding: var(--tlp-medium-spacing) 0 0;
}
