
:root {
    --mxh-bg: #f4f6fb;
    --mxh-card: #ffffff;
    --mxh-text: #172033;
    --mxh-muted: #718096;
    --mxh-border: #e5eaf2;
    --mxh-primary: #2563eb;
    --mxh-primary-dark: #1d4ed8;
    --mxh-soft: #eff6ff;
    --mxh-radius: 18px;
    --mxh-shadow: 0 8px 30px rgba(25, 45, 85, .045);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--mxh-bg);
    color: var(--mxh-text);
    min-height: 100vh;
    font-family: Inter, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

a {
    text-decoration: none;
}

.navbar {
    background: #fff !important;
    border-bottom: 1px solid var(--mxh-border);
    box-shadow: 0 2px 10px rgba(20, 35, 70, .025);
}

.navbar-brand {
    color: var(--mxh-text) !important;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -.6px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: white;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: .72em;
    margin-right: 6px;
    font-weight: 800;
}

.container {
    max-width: 1480px;
}

.card {
    background: var(--mxh-card);
    border: 1px solid var(--mxh-border);
    border-radius: var(--mxh-radius);
    box-shadow: var(--mxh-shadow);
}

.card.p-4 {
    padding: 28px !important;
}

.card h1,
.card h2,
.card h3 {
    color: #172033;
    letter-spacing: -.5px;
    font-weight: 750;
}

.card h1 {
    font-size: 1.75rem;
}

.card h2 {
    font-size: 1.25rem;
}

.text-secondary {
    color: var(--mxh-muted) !important;
}

.form-label {
    font-weight: 650;
    font-size: .9rem;
    color: #344054;
    margin-bottom: 8px;
}

.form-control,
.form-select {
    min-height: 46px;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    padding: 10px 13px;
    color: var(--mxh-text);
    background-color: #fff;
    box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--mxh-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10) !important;
}

textarea.form-control {
    min-height: 100px;
}

.btn {
    border-radius: 10px;
    font-weight: 650;
    transition: all .18s ease;
}

.btn-primary {
    background: var(--mxh-primary);
    border-color: var(--mxh-primary);
}

.btn-primary:hover {
    background: var(--mxh-primary-dark);
    border-color: var(--mxh-primary-dark);
    transform: translateY(-1px);
}

.btn-lg {
    padding: 12px 22px;
}

.btn-outline-primary {
    border-color: #bfd2ff;
    color: var(--mxh-primary);
}

.btn-outline-primary:hover {
    background: var(--mxh-soft);
    color: var(--mxh-primary-dark);
    border-color: var(--mxh-primary);
}

hr {
    border-color: var(--mxh-border);
    opacity: 1;
    margin: 24px 0;
}

/* Upload area */

.drop-zone {
    position: relative;
    border: 2px dashed #b9c9e3;
    border-radius: 17px;
    background: linear-gradient(145deg, #f8fbff, #f2f6ff);
    padding: 42px 20px;
    min-height: 205px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all .2s ease;
    outline: none;
}

.drop-zone:hover,
.drop-zone:focus-visible {
    border-color: var(--mxh-primary);
    background: #eff6ff;
}

.drop-zone.drag-over {
    border: 2px dashed var(--mxh-primary);
    background: #e8f1ff;
    transform: scale(1.005);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .07);
}

.drop-zone-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #e3edff;
    color: var(--mxh-primary);
    font-size: 29px;
    margin-bottom: 13px;
}

.drop-zone .fw-semibold {
    font-size: 1.05rem;
    color: #24344d;
}

.drop-zone .btn-link {
    font-weight: 700;
    text-decoration: none;
}

#selectedCount {
    border-radius: 30px;
    padding: 7px 12px;
    font-size: .78rem;
}

/* Individual file previews */

#fileOptions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.file-option {
    position: relative;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--mxh-border);
    border-radius: 13px;
    padding: 13px;
    margin: 0;
    transition: border-color .2s, box-shadow .2s;
}

.file-option:hover {
    border-color: #c5d5f5;
    box-shadow: 0 4px 14px rgba(30, 60, 110, .05);
}

.file-option-top {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    margin-bottom: 12px;
}

.file-preview {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    border-radius: 10px;
    background: #f0f3f8;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: #718096;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-option .form-control {
    min-height: 39px;
    font-size: .83rem;
    margin-bottom: 8px;
}

.file-option .file-name {
    font-size: .85rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.file-option .file-size {
    color: var(--mxh-muted);
    font-size: .75rem;
}

.remove-file {
    border: 0;
    background: #fff0f0;
    color: #dc3545;
    width: 29px;
    height: 29px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: 0 0 29px;
    font-size: 17px;
}

.remove-file:hover {
    background: #dc3545;
    color: white;
}

.min-w-0 {
    min-width: 0;
}

/* WebP settings */

.quality-wrap {
    background: #f7f9fd;
    border: 1px solid var(--mxh-border);
    border-radius: 13px;
    padding: 17px;
    transition: opacity .2s;
}

.quality-wrap.disabled {
    opacity: .45;
}

.form-check-input {
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--mxh-primary);
    border-color: var(--mxh-primary);
}

.form-range::-webkit-slider-thumb {
    background: var(--mxh-primary);
}

.form-range::-moz-range-thumb {
    background: var(--mxh-primary);
}

/* Result links */

.link-output {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: .84rem;
    line-height: 1.8;
    background: #f8faff;
}

/* Recent images */

.thumb {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 10px;
    background: #edf0f5;
    border: 1px solid var(--mxh-border);
}

.table {
    --bs-table-bg: transparent;
    font-size: .9rem;
}

.table th {
    color: var(--mxh-muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 700;
    border-bottom-color: var(--mxh-border);
}

.table td {
    vertical-align: middle;
    border-bottom-color: #edf0f5;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

/* Sidebar */

.list-group-item {
    background: transparent;
    border-color: var(--mxh-border);
    padding: 13px 10px;
}

.list-group-item:last-child {
    border-bottom: 0;
}

/* Public gallery */

.hero {
    background: linear-gradient(135deg, #fff 0%, #edf4ff 55%, #f4efff 100%);
    border: 1px solid #e2e9f6;
    border-radius: 20px;
}

.gallery-item {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid var(--mxh-border);
    border-radius: 13px;
    overflow: hidden;
    height: 100%;
    transition: transform .18s, box-shadow .18s;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(19, 38, 76, .10);
}

.gallery-item img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    background: #edf0f5;
    display: block;
}

.gallery-item span {
    display: block;
    padding: 11px 13px;
    font-size: .9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-full {
    max-height: 75vh;
    object-fit: contain;
    background: #e9edf3;
}

.auth-card {
    max-width: 440px;
}

footer {
    border-top: 1px solid var(--mxh-border);
    color: var(--mxh-muted);
    margin-top: 45px !important;
    padding-top: 22px;
}

/* Upload button */

#uploadForm button[type="submit"] {
    min-width: 175px;
}

#uploadForm button[disabled] {
    opacity: .75;
    cursor: wait;
}

/* Responsive */

@media(max-width: 767px) {
    .card.p-4 {
        padding: 19px !important;
    }

    #fileOptions {
        grid-template-columns: 1fr;
    }

    .drop-zone {
        padding: 30px 14px;
        min-height: 180px;
    }

    .gallery-item img {
        height: 150px;
    }

    .display-5 {
        font-size: 2.4rem;
    }
}

@media(max-width: 420px) {
    .drop-zone {
        padding: 24px 10px;
    }

    .file-option {
        padding: 10px;
    }

    .thumb {
        width: 46px;
        height: 46px;
    }
}

