:root {
    --primary: #111827 !important;
    --secondary: #38bdf8 !important;
    --success: #659157 !important;
    --warning: #E0A458 !important;
    --danger: #CD3C4D !important;
}

body {
    background-color: #0b1220;
    color: #d7e2f0;
}

.container.page-content {
    background-color: #0f1a2d;
    border: 1px solid #2f4462;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    padding-bottom: 1rem;
}

.btn-success:hover, .btn-success:disabled, .btn-success {
    border-color: var(--success);
    background-color: var(--success);
}

.btn-warning:hover, .btn-warning:disabled, .btn-warning {
    border-color: var(--warning);
    background-color: var(--warning);
}

.btn-danger:hover, .btn-danger:disabled, .btn-danger {
    border-color: var(--danger);
    background-color: var(--danger);
}

.bg-primary {
    background-color: var(--primary) !important;
}

.navbar-dark .navbar-brand {
    color: #f3f7ff;
}

.navbar-dark .navbar-brand:hover,
.navbar-dark .navbar-brand:focus {
    color: #ffffff;
}

.text-danger {
    color: var(--danger);
}

.text-secondary,
.small.text-muted,
small {
    color: #9fb0c7 !important;
}

.thumbnail {
    max-width: 200px;
}

a {
    color: var(--secondary);
}

a:hover,
a:focus {
    color: #7dd3fc;
}

.card {
    background-color: #16243a;
    border-color: #3a5272 !important;
    color: #d7e2f0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.card-header {
    background-color: #1d2f48;
    border-bottom-color: #3a5272;
    color: #f2f7ff;
}

.form-control,
.custom-file-label {
    background-color: #0f1a2b;
    border-color: #334964;
    color: #e6eef9;
}

.form-control:disabled,
.form-control[readonly] {
    background-color: #0c1625;
    border-color: #2a3e58;
    color: #8fa4bf;
    opacity: 1;
}

.form-control:focus,
.custom-file-input:focus ~ .custom-file-label {
    background-color: #0f1a2b;
    border-color: var(--secondary);
    color: #f2f7ff;
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.2);
}

.custom-file-label::after {
    background-color: #1a2a43;
    color: #d7e2f0;
    border-left-color: #334964;
}

.custom-control-label {
    color: #d0dcec;
}

#information-text {
    color: #f87171;
}

.random-image {
    width: auto;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
}

.history-image-wrapper {
    width: 100%;
    min-height: 25vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.history-image {
    width: auto;
    max-width: 100%;
    max-height: 22vh;
    object-fit: contain;
}

#history-container {
    max-height: calc(100vh - 2 * 0.3125rem - 1.25rem - 2 * 0.5rem - 1rem - 2 * 1.5rem - 6rem);
    overflow-y: auto;
}

html,
body {
    height: 100%;
}

.page-content {
    flex: 1 0 auto;
}

.sticky-footer {
    background-color: #111827 !important;
    color: #9fb0c7 !important;
}

#navbarwrapper {
    background-color: #162238 !important;
    border-bottom: 1px solid #2d3f5a;
    margin-bottom: 0.75rem;
}

#footerwrapper {
    background-color: #0d1728 !important;
    border-top: 1px solid #2a3b55;
    margin-top: 0.75rem;
}

#random-image-div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#random-image {
    max-width: 100%;
    max-height: 100%;
}

@media (max-width: 767.98px) {
    #pick-action-buttons {
        display: flex;
        align-items: stretch;
        justify-content: center;
        gap: 0.25rem;
    }

    #pick-action-buttons .btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 0.3rem 0.25rem;
        font-size: 0.72rem;
        line-height: 1.2;
        white-space: nowrap;
    }

    #pick-action-buttons .btn.ml-2 {
        margin-left: 0 !important;
    }
}

@media (min-width: 992px) {
    #step-2 .row {
        height: calc(100dvh - 10rem);
    }

    #step-2 .col-lg-8 {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    #random-image-controls-div {
        flex: 0 0 auto;
    }

    #random-image-div {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }
}

.img-thumbnail.random-image {
    padding: 10px;
    border-radius: .25rem;
    transition: background-color 1s;
}

.img-thumbnail.random-selected {
    background-color: var(--primary);
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--secondary) !important;
    box-shadow: 0 0 3px var(--secondary) !important;
}

.custom-switch .custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 3px var(--secondary) !important;
}

.custom-switch .custom-control-input:active ~ .custom-control-label::before {
    box-shadow: 0 0 3px var(--secondary) !important;
    background: var(--secondary) !important;
}
