:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --background: #f0f2f5;
    --gradient-main: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
body { background: var(--background); font-family: system-ui, -apple-system, sans-serif; padding-bottom: 0px; }
.gradient-bg { background: var(--gradient-main); color: white; }
.header-rounded { border-bottom-left-radius: 30px; border-bottom-right-radius: 30px; padding: 40px 20px 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.card-custom { border-radius: 20px; border: none; box-shadow: 0 4px 15px rgba(0,0,0,0.05); background: white; }
.btn-gradient { background: var(--gradient-main); color: white; border: none; padding: 12px 20px; border-radius: 50px; font-weight: 600; box-shadow: 0 4px 15px rgba(102,126,234,0.3); transition: transform 0.2s; }
.btn-gradient:hover { transform: scale(1.02); color: white; }
.input-custom { border-radius: 15px; padding: 12px 15px; border: 2px solid #e2e8f0; }
.input-custom:focus { border-color: var(--primary); box-shadow: 0 0 0 0.25rem rgba(102,126,234,0.25); }
.bottom-nav { position: fixed; bottom: 0; width: 100%; height: 75px; background: white; border-top-left-radius: 24px; border-top-right-radius: 24px; box-shadow: 0 -4px 20px rgba(0,0,0,0.05); display: flex; justify-content: space-around; align-items: center; z-index: 1000; }
.nav-item { text-align: center; color: #a0aec0; text-decoration: none; font-size: 11px; font-weight: 600; flex: 1; }
.nav-item.active { color: var(--primary); }
.nav-item i { font-size: 24px; display: block; margin-bottom: 2px; }
.fab-container { position: relative; top: -20px; }
.fab { width: 60px; height: 60px; border-radius: 50%; background: var(--gradient-main); color: white; display: flex; align-items: center; justify-content: center; font-size: 32px; border: 4px solid #f0f2f5; box-shadow: 0 5px 15px rgba(102,126,234,0.4); text-decoration: none; }
.avatar-lg { width: 80px; height: 80px; border-radius: 20px; background: var(--gradient-main); color: white; display: flex; align-items: center; justify-content: center; font-size: 40px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.stat-card { background: white; border-radius: 16px; padding: 16px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.quick-action-card { background: white; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #2d3748; box-shadow: 0 2px 10px rgba(0,0,0,0.02); transition: transform 0.2s; }
.filter-chip { padding: 8px 20px; border-radius: 50px; border: 1px solid #e2e8f0; background: white; color: #718096; font-size: 14px; font-weight: 600; text-wrap: nowrap; cursor: pointer; }
.filter-chip.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Dark Mode Overrides */
[data-bs-theme="dark"] {
    --background: #121212;
    --bs-body-bg: #121212;
    --bs-body-color: #e0e0e0;
}
[data-bs-theme="dark"] body {
    background: var(--background);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .card-custom:not(.active):not(.bg-primary), 
[data-bs-theme="dark"] .stat-card, 
[data-bs-theme="dark"] .quick-action-card, 
[data-bs-theme="dark"] .bottom-nav {
    background: #1e1e1e !important;
    color: #e0e0e0 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
}
[data-bs-theme="dark"] .card-custom.active,
[data-bs-theme="dark"] .card-custom.bg-primary {
    color: #ffffff !important;
}
[data-bs-theme="dark"] .text-dark { color: #e0e0e0 !important; }
[data-bs-theme="dark"] .bg-light { background-color: #2c2c2c !important; color: #e0e0e0 !important; }
[data-bs-theme="dark"] .bg-white { background-color: #1e1e1e !important; }
[data-bs-theme="dark"] .filter-chip { background: #1e1e1e; color: #a0aec0; border-color: #333; }
[data-bs-theme="dark"] .input-custom { background: #1e1e1e; border-color: #333; color: #e0e0e0; }
[data-bs-theme="dark"] .offcanvas { background-color: #1e1e1e; color: #e0e0e0; }
[data-bs-theme="dark"] .list-group-item { background-color: #1e1e1e; color: #e0e0e0; border-color: #333; }
[data-bs-theme="dark"] .modal-content { background-color: #1e1e1e; color: #e0e0e0; }
[data-bs-theme="dark"] .border-bottom { border-bottom-color: #333 !important; }
[data-bs-theme="dark"] .border { border-color: #333 !important; }

/* Branded Modal Styles */
.brand-modal-content {
    border-radius: 20px;
    border: none;
    margin-top: 50px; /* Space for the floating circle */
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.brand-modal-header-circle {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 90px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 15px rgba(102,126,234,0.4);
    z-index: 1055;
    border: 5px solid white;
}

.brand-modal-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.brand-modal-header {
    border-bottom: none !important;
    padding-top: 55px !important; /* Push title below the half circle */
    padding-bottom: 0;
    justify-content: center;
}

.brand-modal-title {
    font-weight: 800;
    text-align: center;
    width: 100%;
}

.brand-modal-body {
    padding: 20px 25px 25px;
}

[data-bs-theme="dark"] .brand-modal-content {
    background-color: #1e1e1e;
}

[data-bs-theme="dark"] .brand-modal-header-circle {
    border-color: #1e1e1e;
}


/* CUSTOM */
/* Base Styles (Light Mode) */
.thumbnailbox {
    max-width: 200px;
    text-align: center;
    padding: 10px 10px;
    background-color: #fff;
    border: 1px solid #eaeaea;
    margin-bottom: 10px;
}

.thumbnailboxwithshadow {
    max-width: 250px;
    min-width:50px;
    text-align: center;
    padding: 10px 10px;
    background-color: #fff;
    border: 1px solid #eaeaea;
    -webkit-box-shadow: 0 8px 6px -6px rgb(97, 97, 97);
    -moz-box-shadow: 0 8px 6px -6px rgb(97, 97, 97);
    box-shadow: 0 8px 6px -6px rgb(97, 97, 97);
    margin-bottom: 10px;
}

    .thumbnailbox img, .thumbnailboxwithshadow img {
        max-width: 100%;
    }

.dragwithme, .dontdrag {
    background-color: #000;
    padding: 5px 0px;
    color: #fff;
    margin-bottom: 5px;
}

.imageposition.badge.badge-light {
    color: #000;
    font-weight: bold;
}

.dragwithme span:first-child {
    text-align: left !important;
    width: 80%;
}

.dragwithme span:last-child {
    text-align: right !important;
}

.dontdrag span:first-child {
    text-align: left !important;
    width: 80%;
}

.dontdrag span:last-child {
    text-align: right !important;
}

.alreadyuploadedfilesbox {
    display: block;
    width: 100%;
    margin: 0 auto 25px auto;
    padding: 25px;
    color: #97A1A8;
    background: #eee;
    border: 2px dashed #C8CBCE;
    text-align: center;
    -webkit-transition: box-shadow 0.3s, border-color 0.3s;
    -moz-transition: box-shadow 0.3s, border-color 0.3s;
    transition: box-shadow 0.3s, border-color 0.3s;
}

.removeimage {
    color: #ef3f3e;
    font-size: 16px;
}

/* ========================================= */
/* Dark Mode Overrides                       */
/* ========================================= */

[data-bs-theme="dark"] .thumbnailbox,
[data-bs-theme="dark"] .thumbnailboxwithshadow {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
}

[data-bs-theme="dark"] .thumbnailboxwithshadow {
    -webkit-box-shadow: 0 8px 6px -6px rgba(0, 0, 0, 0.4);
    -moz-box-shadow: 0 8px 6px -6px rgba(0, 0, 0, 0.4);
    box-shadow: 0 8px 6px -6px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .dragwithme,
[data-bs-theme="dark"] .dontdrag {
    background-color: #2c2c2c !important;
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .imageposition.badge.badge-light {
    background-color: #2c2c2c !important;
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .alreadyuploadedfilesbox {
    color: #a0aec0 !important;
    background: #1e1e1e !important;
    border-color: #444 !important;
}

[data-bs-theme="dark"] .removeimage {
    color: #ff5252 !important; /* Slightly brighter red for better contrast on dark gray */
}
