﻿.ab-button {
    position: relative;
    display: inline-block;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
    background: transparent;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}


/* ============================================================
   METAL OUTER BEZEL
   ============================================================ */

.metal-bezel {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: linear-gradient( 135deg, #f2f2f2 0%, #aaaaaa 18%, #dddddd 35%, #909090 52%, #d5d5d5 70%, #999999 86%, #eeeeee 100% );
    box-shadow: inset 0 2px 2px rgba(255,255,255,.9), inset 0 -3px 4px rgba(0,0,0,.55), 0 3px 6px rgba(0,0,0,.45);
}

.round .metal-bezel {
    border-radius: 50%;
}


/* ============================================================
   BLACK PADDED SURROUND
   ============================================================ */

.black-surround {
    width: 88%;
    height: 88%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    /*
       Thick black padded border.
       The highlights make it look slightly rubberized.
    */
    background: linear-gradient( to bottom, #414141 0%, #191919 38%, #080808 65%, #303030 100% );
    box-shadow: inset 0 2px 2px rgba(255,255,255,.16), inset 0 -3px 4px rgba(0,0,0,.9), 0 1px 2px rgba(0,0,0,.75);
}

.round .black-surround {
    border-radius: 50%;
}


/* ============================================================
   COLORED BUTTON CAP
   ============================================================ */

.button-cap {
    position: relative;
    width: 82%;
    height: 82%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 5px;
    background: linear-gradient( to bottom, rgba(255,255,255,.38) 0%, rgba(255,255,255,.10) 15%, rgba(255,255,255,0) 42%, rgba(0,0,0,.12) 72%, rgba(0,0,0,.40) 100% ), var(--button-color);
    /*
       Raised position
    */
    transform: translateY(-3px);
    box-shadow: inset 0 3px 4px rgba(255,255,255,.45), inset 0 -5px 7px rgba(0,0,0,.45), 0 4px 5px rgba(0,0,0,.65);
    transition: transform .055s linear, box-shadow .055s linear;
}

.round .button-cap {
    border-radius: 50%;
}


/* ============================================================
   PHYSICAL PRESS
   ============================================================ */

.is-pressed .button-cap,
.logical-pressed .button-cap {
    transform: translateY(2px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,.50), inset 0 -2px 3px rgba(255,255,255,.18), 0 1px 2px rgba(0,0,0,.55);
}


/* ============================================================
   HIGHLIGHT ON BUTTON CAP
   ============================================================ */

.cap-highlight {
    position: absolute;
    left: 12%;
    top: 7%;
    width: 76%;
    height: 25%;
    border-radius: 50%;
    background: linear-gradient( to bottom, rgba(255,255,255,.48), rgba(255,255,255,0) );
    pointer-events: none;
}


/* ============================================================
   TEXT
   ============================================================ */

.button-text {
    position: relative;
    z-index: 2;
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: .5px;
    text-shadow: 0 1px 2px rgba(0,0,0,.85);
    pointer-events: none;
}


/* ============================================================
   COLORS
   ============================================================ */

.color-red {
    --button-color: #d00000;
}

.color-green {
    --button-color: #009b16;
}

.color-yellow {
    --button-color: #e4bd00;
}

.color-blue {
    --button-color: #0879c9;
}

.color-white {
    --button-color: #d8d8d8;
}

.color-black {
    --button-color: #202020;
}

.color-gold {
    --button-color: #9c7f4e;
}

.color-white .button-text {
    color: #202020;
    text-shadow: 0 1px 1px rgba(255,255,255,.8);
}

/* ============================================================
   DISABLED
   ============================================================ */
.ab-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}
