/* =========================================================
   Internet Time Machine
   Core Application Styles
   ========================================================= */


/* ---------------------------------------------------------
   Global reset
   --------------------------------------------------------- */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* ---------------------------------------------------------
   Document
   --------------------------------------------------------- */

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f5f5;
    color: #222;
}


/* ---------------------------------------------------------
   Application
   --------------------------------------------------------- */

#app {
    width: 100%;
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}


/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */

#app-header {
    width: 100%;
    padding: 20px;

    background: #ffffff;
    border-bottom: 1px solid #cccccc;
}

#app-title {
    font-size: 24px;
    font-weight: 600;
}


/* ---------------------------------------------------------
   Main content
   --------------------------------------------------------- */

#app-content {
    width: 100%;
    max-width: 1100px;

    margin: 0 auto;
    padding: 30px 20px;

    flex: 1;
}


/* ---------------------------------------------------------
   Era selector
   --------------------------------------------------------- */

#era-selector {
    margin-bottom: 25px;
}

#era-selector h2 {
    margin-bottom: 15px;

    font-size: 20px;
    font-weight: 600;
}

#era-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}


/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

button {
    font: inherit;
}

.era-button,
.service-button {
    padding: 9px 16px;

    background: #ffffff;
    color: #222;

    border: 1px solid #bbbbbb;
    border-radius: 4px;

    cursor: pointer;
}

.era-button:hover,
.service-button:hover {
    background: #eeeeee;
}

.era-button.active {
    background: #222;
    color: #ffffff;
    border-color: #222;
}


/* ---------------------------------------------------------
   Current era
   --------------------------------------------------------- */

#current-era {
    margin-bottom: 25px;

    font-size: 15px;
}

#current-era-name {
    font-weight: 700;
}


/* ---------------------------------------------------------
   Service navigation
   --------------------------------------------------------- */

#service-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-bottom: 25px;
}


/* ---------------------------------------------------------
   Page container
   --------------------------------------------------------- */

#page-container {
    width: 100%;
    min-height: 300px;

    padding: 25px;

    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 5px;

    box-sizing: border-box;
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

#app-footer {
    width: 100%;

    padding: 15px 20px;

    background: #ffffff;
    border-top: 1px solid #cccccc;

    text-align: center;
    font-size: 13px;
    color: #666666;
}


/* ---------------------------------------------------------
   Small screens
   --------------------------------------------------------- */

@media (max-width: 600px) {

    #app-content {
        padding: 20px 15px;
    }

    #app-title {
        font-size: 20px;
    }

    #page-container {
        padding: 18px;
    }

}

/* =========================================================
   Era selector
   ========================================================= */

#era-selector {
    width: 100%;
    margin-bottom: 22px;
}

#era-selector h2 {
    margin-bottom: 10px;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: #666;
}

/* =========================================================
   Custom era dropdown
   ========================================================= */

.era-dropdown {
    position: relative;
    width: 280px;
}


/* ---------------------------------------------------------
   Dropdown button
   --------------------------------------------------------- */

.era-dropdown-button {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 13px 15px;

    background: #ffffff;
    color: #202124;

    border: 1px solid #c7c7c7;
    border-radius: 9px;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.08);

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.era-dropdown-button:hover {
    border-color: #999999;

    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.10);
}

.era-dropdown-button:focus {
    outline: none;

    border-color: #555555;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.08);
}


/* ---------------------------------------------------------
   Arrow
   --------------------------------------------------------- */

.era-dropdown-arrow {
    margin-left: 15px;

    font-size: 15px;

    color: #5f6368;

    transition:
        transform 0.15s ease;
}


/* ---------------------------------------------------------
   Open state
   --------------------------------------------------------- */

.era-dropdown-button[aria-expanded="true"] .era-dropdown-arrow {
    transform: rotate(180deg);
}


/* ---------------------------------------------------------
   Dropdown menu
   --------------------------------------------------------- */

.era-dropdown-menu {
    position: absolute;

    top: calc(100% + 6px);
    left: 0;

    width: 100%;

    padding: 6px;

    background: #ffffff;

    border: 1px solid #dadce0;
    border-radius: 10px;

    box-shadow:
        0 4px 16px rgba(60, 64, 67, 0.20);

    z-index: 1000;
}


/* ---------------------------------------------------------
   Dropdown options
   --------------------------------------------------------- */

.era-dropdown-option {
    width: 100%;

    display: flex;
    align-items: center;

    padding: 11px 12px;

    background: transparent;
    color: #202124;

    border: none;
    border-radius: 7px;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;

    text-align: left;

    cursor: pointer;
}

.era-dropdown-option:hover {
    background: #f1f3f4;
}


/* ---------------------------------------------------------
   Selected option
   --------------------------------------------------------- */

.era-dropdown-option.active {
    background: #f1f3f4;

    font-weight: 600;
}

.era-dropdown-option.active::after {
    content: "✓";

    margin-left: auto;

    color: #5f6368;

    font-weight: 700;
}


/* ---------------------------------------------------------
   Hidden state
   --------------------------------------------------------- */

.era-dropdown-menu[hidden] {
    display: none;
}