:root {
    --primary: #8b1e3f;
    --primary-dark: #5f122a;
    --secondary: #e8b4c3;

    --bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.75);

    --text: #1e293b;
    --muted: #64748b;

    --border: rgba(255, 255, 255, 0.3);

    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);

    --radius: 20px;
}

/* Background */

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, #fde7ef, transparent 40%),
        radial-gradient(circle at bottom right, #dcecff, transparent 40%),
        linear-gradient(135deg, #f8fafc, #eff4ff);
    color: var(--text);
    font-family: "Inter";
    animation: fadeIn 0.8s ease-out;
}

/* Navbar */

.app-navbar {
    background: rgba(139, 30, 63, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: .5px;
}

/* Cards */

.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .3s ease,
        box-shadow .3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-weight: 700;
}

/* Inputs */

.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid #dce3ee;
    transition: all .25s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .25rem rgba(139, 30, 63, 0.15);
}

textarea {
    resize: vertical;
}

/* Upload Section */

#uploadPanel {
    overflow: hidden;
}

#uploadPanel .card-body {
    padding: 2rem;
}

/* Buttons */

.btn {
    border-radius: 12px;
    transition: all .25s ease;
}

.btn-primary {
    border: none;
    background: linear-gradient(135deg,
            var(--primary),
            #b32957);
}

.btn-primary:hover {
    /*transform: translateY(-2px);*/
    box-shadow: 0 8px 20px rgba(139, 30, 63, .3);
}

.btn-success {
    border: none;
    background: linear-gradient(135deg,
            var(--primary),
            #b32957);
}

.btn-success:hover {
    /*transform: translateY(-3px);*/
    box-shadow: 0 12px 24px rgba(139, 30, 63, .35);
}
/*
.btn-outline-secondary:hover,
.btn-outline-danger:hover {
    transform: translateY(-2px);
}*/

/* Image Viewer */

.image-frame {
    position: relative;
    overflow: hidden;
    background: #f3f3f3;
}

/* Blurred background */
.image-backdrop {
    position: absolute;
    inset: -20px;
    /* gives the blur some room */
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(5px);
    transform: scale(1.20);
    opacity: 0.8;
}

/* Sharp foreground image */
.image-frame img {
    z-index: 1;
    object-fit: contain;
    transition: transform .5s ease;
}

.image-frame:hover img {
    transform: scale(1.04);
}


/* Thumbnail Gallery */
.thumb {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 14px;
    border: 2px solid transparent;
    cursor: pointer;
    display: block;
    opacity: .7;
    transition: all .25s ease;
}

.thumb:hover {
    opacity: 1;
    transform: translateY(-4px) scale(1.05);
}

.thumb.active {
    opacity: 1;
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(139, 30, 63, .3);
}

/* Export button */

#exportBtn {
    padding: 0.8rem 1.8rem;
    font-weight: 600;
}

/* Empty state */

#emptyState {
    animation: floatIn .8s ease;
}

#emptyState p {
    font-size: 1.2rem;
    color: var(--muted);
}

/* Badge styling */

.badge {
    border-radius: 999px;
}

/* Save Status */

#saveStatus.text-success {
    color: #16a34a !important;
}

#saveStatus.text-danger {
    color: #dc2626 !important;
}

/* Scrollbars */

::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 30, 63, .4);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 30, 63, .7);
}

/* Animations */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
#viewer,
#uploadPanel {
    animation: fadeIn .5s ease;
}

/* Responsive */

@media (max-width: 768px) {
    .card-body {
        padding: 1.25rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .thumb {
        width: 60px;
        height: 60px;
    }
}
.thumbnail-item {
    position: relative;
    width: 72px;
    height: 72px;
}

.processing-overlay {
    position: absolute;
    inset: 0;

    background-color: rgba(255, 255, 255, 0.8);

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 10;
}

.loader-spinner {
    width: 30px;
    aspect-ratio: 1;
    border-radius: 50%;

    background:
        radial-gradient(farthest-side,
            #8b1e3fd9 95%,
            #0000) 50% 1px/8px 8px no-repeat,
        radial-gradient(farthest-side,
            #0000 calc(100% - 8px),
            #ccc 0);

    animation: l9 1s infinite ease;

    z-index: 11;
}

@keyframes l9 {
    to {
        transform: rotate(1turn);
    }
}

.processing-overlay-details {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0%;
    background: white;
    opacity: 0.65;
    border-radius: var(--radius);
}

.loader-spinner-details {
    position: relative;
    top: 45%;
    left: 45%;
    width: 10%;
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(farthest-side,
            #8b1e3fd9 95%,
            #0000) 50% 1px/8px 8px no-repeat,
        radial-gradient(farthest-side,
            #0000 calc(100% - 8px),
            #ccc 0);
    animation: l9 1s infinite ease;
    z-index: 11;
}

.form-control {
    font-size: 0.8rem;
}
.form-select {
    font-size: 0.8rem;
}
