.country-select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;  /* Ensure full width */
}

.country-select-flag {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: auto;
    pointer-events: none;
}

.country-select-wrapper select {
    width: 100%;
    padding-right: 40px;  /* Make space for the flag */
    appearance: none;  /* Remove default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position-x: calc(100% - 25px);
    background-position-y: 50%;
}

.navbar-custom .form-control {
    border: none;
}

.navbar-custom .form-control {
    background-color: rgba(236, 240, 241, 0.1);
    color: #ecf0f1;
}

.navbar-custom .form-control::placeholder {
    color: rgba(236, 240, 241, 0.7);
}
.navbar-custom .form-control:focus {
    background-color: rgba(236, 240, 241, 0.2);
    color: #ecf0f1;
}

.navbar-custom .form-control:focus::placeholder {
    color: rgb(236, 240, 241);
}

.footer-custom {
    background: #253447;
    color: #ecf0f1;
}

.footer-custom a {
    transition: color 0.3s ease;
}

.footer-custom a:hover {
    color: #bdc3c7 !important;
    text-decoration: none;
}

.footer-custom h5 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-custom .fab {
    transition: transform 0.3s ease;
}

.footer-custom .fab:hover {
    transform: scale(1.1);
}
.navbar-custom {
    background: #253447;
    padding: 15px 0;
}

.navbar-custom .navbar-brand,
.navbar-custom .navbar-nav .nav-link {
    color: #ecf0f1;
}

.navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-nav .nav-link:hover {
    color: #bdc3c7;
}

.navbar-custom .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(236, 240, 241, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-brand img {
    max-height: 40px;
    width: auto;
}

.navbar-brand span {
    font-size: 1.2rem;
}

.navbar-custom .input-group {
    width: 300px;
}

.form-control {
    min-height: 44px;
    background-color: #fff;
    border-color: #cbd3dc;
    color: #2c3e50;
}

.form-control:focus {
    background-color: #fff;
    color: #2c3e50;
}

input[type="text"], input[type="email"], input[type="password"], textarea {
    color: #2c3e50;
}

.form-control::placeholder {
    color: rgba(44, 62, 80, 0.7); /* Darker placeholder color */
}

.submission-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.btn-search {
    background-color: #e74c3c;
    color: #ecf0f1;
    border: none;
}

.btn-search:hover {
    background-color: #c0392b;
    color: #ecf0f1;
}
#map {
    height: 31rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease-out;
}

#map:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.asteriskField {
    display: inline;
    margin-left: 0.2rem;
    color: #5f09af;
    font-weight: 700;
}
.lum-photo-card {
    border-radius:4%;
    width:70%;
    height:70%;
    position:absolute;
    top:10%;
    left:17%;
    z-index: 2;
    transition: transform 0.3s ease;
}
.lum-photo-main {
    border-radius:4%;
    width:63%;
    height:63%;
    position:absolute;
    top:11%;
    left:22%;
    transition: transform 0.3s ease;
}

/* Luminaria photo container hover effect */
.luminaria-photo-container:hover .lum-photo-main,
.luminaria-photo-container:hover .lum-photo-card {
    transform: scale(1.02);
}

/* Enhanced luminaria card styling */
.luminaria-main-card {
    border-radius: 1rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.luminaria-main-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
}

.luminaria-title {
    color: #2c3e50;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.05;
    max-width: 18ch;
}

.luminaria-story-text {
    position: relative;
    max-width: 65ch;
    margin: 0;
    padding-left: 2rem;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    line-height: 1.65;
    color: #34495e;
}

.luminaria-story-text::before {
    content: "“";
    position: absolute;
    top: -1.15rem;
    left: 0;
    color: #5f09af;
    font-family: Georgia, serif;
    font-size: 3.5rem;
    line-height: 1;
}

.luminaria-story-text p {
    margin: 0;
}

.luminaria-dedication-label {
    color: #5f09af;
    font-size: 1.05rem;
    font-weight: 700;
}

.luminaria-meta {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

.luminaria-meta p {
    margin-bottom: 0.75rem;
    color: #5f6670;
}

.luminaria-meta i {
    color: #5f09af;
    width: 20px;
    display: inline-block;
}

.event-link {
    color: #5f09af;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.event-link:hover {
    color: #490786;
    text-decoration: underline;
}
body {
    background-color: #FCFCFC;
    color: #253447;
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.btn-primary,
.bg-primary,
.progress-bar {
    background-color: #5f09af !important;
    border-color: #5f09af !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #490786 !important;
    border-color: #490786 !important;
}

.btn-outline-primary {
    color: #5f09af;
    border-color: #5f09af;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: #fff;
    background-color: #5f09af;
    border-color: #5f09af;
}

.text-primary,
a {
    color: #5f09af;
}

a:hover {
    color: #490786;
}

h1,
h2,
h3 {
    color: #253447;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2000;
    padding: 0.75rem 1rem;
    background: #fff;
    color: #2c3e50;
    border: 2px solid #5f09af;
    border-radius: 0.25rem;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid #253447;
    box-shadow: 0 0 0 6px #ffc107;
    outline-offset: 2px;
}

.scroll-anchor {
    scroll-margin-top: 1rem;
}

.home-hero {
    background: #5f09af;
    color: #fff;
    border-radius: 0.5rem;
}

.home-hero .text-primary,
.home-hero .text-muted,
.home-hero .home-stats strong,
.home-hero .home-stats .text-muted {
    color: #fff !important;
}

.home-hero h1 {
    color: #fff;
}

.home-hero .lead {
    color: rgba(255, 255, 255, 0.88) !important;
    max-width: 34rem;
}

.home-hero .btn-primary {
    background: #fff !important;
    border-color: #fff !important;
    color: #490786 !important;
}

.home-hero .btn-primary:hover {
    background: #f2edf8 !important;
    border-color: #f2edf8 !important;
    color: #490786 !important;
}

.home-hero .btn-outline-primary {
    border-color: #fff;
    color: #fff !important;
}

.home-hero .btn-outline-primary:hover {
    background: #fff !important;
    color: #490786 !important;
}

.home-progress {
    background: #490786;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
}

.home-progress .progress {
    background: rgba(255, 255, 255, 0.3);
}

.home-progress .progress-bar {
    background: #fff !important;
}

.filter-panel {
    background: #f2edf8;
    border: 1px solid #ddd5e7;
}

.search-results-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.discovery-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.discovery-header > div {
    max-width: 48rem;
}

.discovery-switcher {
    display: flex;
    flex-shrink: 0;
    gap: 0.5rem;
}

.discovery-switcher .btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.how-it-works {
    display: grid;
    grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 1.6fr);
    gap: clamp(2rem, 5vw, 4rem);
    padding: clamp(1.5rem, 4vw, 3rem);
    border: 1px solid #ddd5e7;
    border-radius: 0.5rem;
    background: #f2edf8;
}

.how-it-works-intro {
    max-width: 32rem;
}

.how-it-works-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: luminaria-steps;
}

.how-it-works-steps li {
    counter-increment: luminaria-steps;
}

.how-it-works-steps li::before {
    content: counter(luminaria-steps);
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    margin-bottom: 1rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #5f09af;
    color: #fff;
    font-weight: 700;
}

.how-it-works-steps strong,
.how-it-works-steps span {
    display: block;
}

.how-it-works-steps strong {
    margin-bottom: 0.4rem;
    color: #253447;
    font-size: 1.1rem;
}

.how-it-works-steps span {
    color: #5f6670;
    line-height: 1.55;
}

.luminaria-result-card {
    min-height: 244px;
}

.luminaria-card-image {
    min-height: 244px;
    overflow: hidden;
}

.luminaria-card-image > img {
    object-fit: cover;
}

.luminaria-card-fallback {
    position: absolute;
    inset: 12% 13% 17%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.75rem;
    border-radius: 0.35rem;
    background: rgba(242, 237, 248, 0.94);
    color: #490786;
    text-align: center;
    line-height: 1.25;
}

.luminaria-card-fallback .fas {
    font-size: 1.5rem;
}

.country-map-shell {
    position: relative;
    min-height: 31rem;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #f2edf8;
}

.country-map-loading {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2rem;
    background: #f2edf8;
    color: #253447;
    text-align: center;
    transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
}

.country-map-loading .fas {
    margin-bottom: 0.5rem;
    color: #5f09af;
    font-size: 3rem;
}

.country-map-loading span {
    max-width: 32rem;
    color: #5f6670;
}

.country-map-shell.is-ready .country-map-loading {
    visibility: hidden;
    opacity: 0;
}

.country-map-loading.is-error {
    background: #fff4f2;
}

.country-map-loading.is-error .fas {
    color: #a52a1a;
}

.country-browser .btn-link {
    min-height: 44px;
}

.form-control-file {
    width: 100%;
    min-height: 52px;
    padding: 0.7rem;
    border: 1px dashed #9483a7;
    border-radius: 0.5rem;
    background: #faf8fc;
}

#global-luminaria-form .input-group {
    width: 100%;
}

.consent-help {
    margin-left: 1.25rem;
    max-width: 40rem;
}

.luminaria-photo-container {
    max-width: 28rem;
    margin-right: auto;
    margin-left: auto;
}

.luminaria-next-actions {
    max-width: 48rem;
    margin: 1rem auto 0;
    padding: clamp(1.5rem, 4vw, 3rem) 1rem 0;
}

.luminaria-next-actions p {
    max-width: 42rem;
    margin-right: auto;
    margin-left: auto;
    color: #5f6670;
    font-size: 1.1rem;
}

details > summary {
    cursor: pointer;
    min-height: 44px;
    padding: 0.65rem 0;
}

.pagination {
    flex-wrap: wrap;
}

html {
    position: relative;
    min-height: 100%;
    scroll-behavior: smooth;
}

/* ======================= */
/* Homepage Enhancements   */
/* ======================= */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
    border: none;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Enhanced card titles */
.card-title {
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: -0.5px;
}

/* Enhanced card text */
.card-text {
    line-height: 1.7;
    color: #495057;
}

/* Improved paragraph spacing */
.card-body p {
    margin-bottom: 1.2rem;
}

.card-body p:last-child {
    margin-bottom: 0;
}

/* Strong text emphasis */
.card-body strong {
    color: #5f09af;
    font-weight: 600;
}

/* Enhanced links */
.card-body a {
    color: #5f09af;
    text-decoration: none;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    font-weight: 500;
    padding-bottom: 1px;
}

.card-body a:hover {
    color: #490786;
    border-bottom-color: #490786;
    text-decoration: none;
}

/* General link styling for better visibility */
a {
    color: #5f09af;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #490786;
    text-decoration: underline;
}

/* Links within text should be more visible */
p a, .lead a {
    color: #5f09af;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid rgba(102, 126, 234, 0.4);
    padding-bottom: 1px;
    transition: all 0.3s ease;
}

p a:hover, .lead a:hover {
    color: #490786;
    border-bottom-color: #490786;
    text-decoration: none;
}

/* Alert links */
.alert a {
    color: #004085;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(0, 64, 133, 0.4);
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
    transition: all 0.3s ease;
    border-bottom: none !important;
}

.alert a:hover {
    color: #002752;
    text-decoration-color: #002752;
}

/* Alert list items - override general list styling */
.alert ul li {
    padding-left: 1.5rem;
}

.alert ul li:before {
    color: #155724;
}

.alert ul li a {
    /* Use only text-decoration, no border-bottom */
    border-bottom: none !important;
    padding-bottom: 0;
}

/* List item links - but NOT in alerts */
ul:not(.alert ul) li a {
    color: #5f09af;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid rgba(102, 126, 234, 0.4);
    padding-bottom: 1px;
}

ul:not(.alert ul) li a:hover {
    color: #490786;
    border-bottom-color: #490786;
}

/* Enhanced alert boxes */
.alert {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.15);
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert h1 {
    font-weight: 700;
    color: #155724;
    margin-bottom: 1rem;
}

.alert ul li {
    margin-bottom: 0.5rem;
}

/* Enhanced iframe containers */
.embed-responsive {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.embed-responsive:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Enhanced pagination */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: 8px;
    margin: 0 4px;
    border: 1px solid #dee2e6;
    color: #5f09af;
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: #5f09af;
    border-color: #5f09af;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

.page-item.active .page-link {
    background: #5f09af;
    border-color: #5f09af;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.page-item.disabled .page-link {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

/* Enhanced section headers */
h2.text-primary {
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

h2.text-primary:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: #5f09af;
    border-radius: 2px;
}

/* Image loading effect */
img {
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.1s forwards;
}

/* Enhanced buttons */
.btn {
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Icon animations */
.fa, .fas, .fab {
    transition: transform 0.3s ease;
}

a:hover .fa,
a:hover .fas,
a:hover .fab {
    transform: scale(1.1);
}

/* Improved text hierarchy */
.lead {
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.7;
    color: #495057;
}

.display-4 {
    font-weight: 700;
    letter-spacing: -1px;
}

.footer-bg {
    background-color: #f5f5f5;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 3.5rem;
    /* Set the fixed height of the footer here */
    line-height: 3.5rem;
    /* Vertically center the text there */
}
/* Share panel */
.share-card-gradient {
    background: #5f09af;
    border-radius: 0.75rem;
    box-shadow: 0 10px 28px rgba(37, 52, 71, 0.16);
}

.share-card-content {
    opacity: 1;
}

.share-icon-wrapper {
    display: inline-block;
}

.share-icon {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Enhanced typography */
.share-title {
    font-size: 2rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.share-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Enhanced button styling */
.share-button {
    background-color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.2s ease-out, box-shadow 0.2s ease-out, transform 0.2s ease-out;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: #490786;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(37, 52, 71, 0.25);
    background: #f2edf8;
    color: #490786;
}

.share-button:active {
    transform: translateY(-1px) scale(0.98);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .share-title {
        font-size: 1.5rem;
    }

    .share-subtitle {
        font-size: 1rem;
    }

    .share-button {
        font-size: 1rem;
        padding: 0.75rem 2rem !important;
    }

    .discovery-header {
        align-items: stretch;
        flex-direction: column;
        gap: 1.25rem;
    }

    .discovery-switcher .btn {
        flex: 1;
    }

    .search-results-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .how-it-works {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .how-it-works-steps {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .how-it-works-steps li {
        padding: 1.25rem 0;
        border-top: 1px solid #d6cce0;
    }

    .how-it-works-steps li:first-child {
        padding-top: 0;
        border-top: 0;
    }

    .country-map-shell,
    #map {
        min-height: 22rem;
        height: 22rem;
    }

    .navbar-custom .input-group {
        width: 100%;
    }

    .luminaria-story-text {
        padding-left: 1.5rem;
    }
}

.share-card-gradient .btn-light {
    background-color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: #333;
}

.share-card-gradient .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background-color: #f8f9fa;
    color: #333;
}

.share-card-gradient .btn-light i {
    color: #333;
}

.social-share {
    font-size: 16px;
    font-size: calc(1.4rem + 2vmin);;
}

/* BEGIN SELECT2 BOOSTRAP4 THEME */
.select2-container {
    display: block;
}
.select2-container *:focus {
    outline: 0;
}
.input-group .select2-container--bootstrap4 {
    -webkit-box-flex: 1;
    -ms-flex-positive: 1;
    flex-grow: 1;
}
.input-group-prepend ~ .select2-container--bootstrap4 .select2-selection {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.input-group > .select2-container--bootstrap4:not(:last-child) .select2-selection {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.select2-container--bootstrap4 .select2-selection {
    width: 100%;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    -webkit-transition: border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
    transition: border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
    .select2-container--bootstrap4 .select2-selection {
        -webkit-transition: none;
        transition: none;
    }
}
.select2-container--bootstrap4.select2-container--focus .select2-selection {
    border-color: #80bdff;
    -webkit-box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.select2-container--bootstrap4.select2-container--focus.select2-container--open .select2-selection {
    border-bottom: none;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}
.select2-container--bootstrap4.select2-container--open.select2-container--above .select2-selection {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.select2-container--bootstrap4.select2-container--open.select2-container--below .select2-selection {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}
.select2-container--bootstrap4.select2-container--disabled .select2-selection,
.select2-container--bootstrap4.select2-container--disabled.select2-container--focus .select2-selection {
    cursor: not-allowed;
    background-color: #e9ecef;
    border-color: #ced4da;
    -webkit-box-shadow: none;
    box-shadow: none;
}
.select2-container--bootstrap4.select2-container--disabled .select2-search__field,
.select2-container--bootstrap4.select2-container--disabled.select2-container--focus .select2-search__field {
    background-color: transparent;
}
select.is-invalid ~ .select2-container--bootstrap4 .select2-selection,
form.was-validated select:invalid ~ .select2-container--bootstrap4 .select2-selection {
    border-color: #dc3545;
}
select.is-valid ~ .select2-container--bootstrap4 .select2-selection,
form.was-validated select:valid ~ .select2-container--bootstrap4 .select2-selection {
    border-color: #28a745;
}
.select2-container--bootstrap4 .select2-search {
    width: 100%;
}
.select2-container--bootstrap4 .select2-dropdown {
    border-color: #ced4da;
    border-radius: 0;
}
.select2-container--bootstrap4 .select2-dropdown.select2-dropdown--below {
    border-top: none;
    border-bottom-right-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}
.select2-container--bootstrap4 .select2-dropdown.select2-dropdown--above {
    border-top: 1px solid #ced4da;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
}
.select2-container--bootstrap4 .select2-dropdown .select2-results__option[aria-selected="true"] {
    color: #212529;
    background-color: #f2f2f2;
}
.select2-container--bootstrap4 .select2-results__option--highlighted,
.select2-container--bootstrap4 .select2-results__option--highlighted.select2-results__option[aria-selected="true"] {
    color: #fff;
    background-color: #007bff;
}
.select2-container--bootstrap4 .select2-results__option[role="group"] {
    padding: 0;
}
.select2-container--bootstrap4 .select2-results__option[role="group"] .select2-results__options--nested .select2-results__option {
    padding-left: 1em;
}
.select2-container--bootstrap4 .select2-results__option {
    padding: 0.375rem 0.75rem;
}
.select2-container--bootstrap4 .select2-results > .select2-results__options {
    max-height: 15em;
    overflow-y: auto;
}
.select2-container--bootstrap4 .select2-results__group {
    display: list-item;
    padding: 6px;
    color: #6c757d;
}
.select2-container--bootstrap4 .select2-selection__clear {
    float: right;
    width: 0.9em;
    height: 0.9em;
    padding-left: 0.15em;
    margin-top: 0.7em;
    margin-right: 0.3em;
    line-height: 0.75em;
    color: #f8f9fa;
    background-color: #c8c8c8;
    border-radius: 100%;
}
.select2-container--bootstrap4 .select2-selection__clear:hover {
    background-color: #afafaf;
}
.select2-container--bootstrap4 .select2-selection--single {
    height: calc(1.5em + 0.75rem + 2px) !important;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    line-height: calc(1.5em + 0.75rem);
    color: #6c757d;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    position: absolute;
    top: 50%;
    right: 3px;
    width: 20px;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
    position: absolute;
    top: 60%;
    left: 50%;
    width: 0;
    height: 0;
    margin-top: -2px;
    margin-left: -4px;
    border-color: #343a40 transparent transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    padding-left: 0.75rem;
    line-height: calc(1.5em + 0.75rem);
    color: #495057;
}
.select2-search--dropdown .select2-search__field {
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}
.select2-results__message {
    color: #6c757d;
}
.select2-container--bootstrap4 .select2-selection--multiple {
    min-height: calc(1.5em + 0.75rem + 2px) !important;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    width: 100%;
    padding: 0 0.375rem;
    margin: 0;
    list-style: none;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
    float: left;
    padding: 0;
    padding-right: 0.75rem;
    margin-top: calc(0.375rem - 2px);
    margin-right: 0.375rem;
    color: #495057;
    cursor: pointer;
    border: 1px solid #bdc6d0;
    border-radius: 0.2rem;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-search__field {
    color: #495057;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice + .select2-search {
    width: 0;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove {
    float: left;
    padding-right: 3px;
    padding-left: 3px;
    margin-right: 1px;
    margin-left: 3px;
    font-weight: 700;
    color: #bdc6d0;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #343a40;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear {
    position: absolute !important;
    top: 0;
    right: 0.7em;
    float: none;
    margin-right: 0;
}
.select2-container--bootstrap4.select2-container--disabled .select2-selection--multiple .select2-selection__choice {
    padding: 0 5px;
    cursor: not-allowed;
}
.select2-container--bootstrap4.select2-container--disabled .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove {
    display: none;
}

/* Remove overlay from croppie viewport to keep functionality clean */
.cr-viewport {
    border: 3px solid #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

/* Luminaria preview styles (simplified: bag as background, image positioned like final render) */
.luminaria-preview {
    position: relative;
    width: 300px; /* logical preview width - increased for better visibility */
    aspect-ratio: 716 / 976; /* maintain output ratio */
    background: url("/static/img/LuminariaBackground.229437b49dbe.webp") center/cover no-repeat;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
}

/* Matches .lum-photo-main placement used in final display */
.luminaria-preview-image {
    position: absolute;
    top: 11%;
    left: 22%;
    width: 63%;
    height: 63%;
    object-fit: cover;
    border-radius: 4%;
    display: none; /* shown when populated */
}

.preview-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
    pointer-events: none;
}

/* Enhanced Croppie Modal Styles */
#crop-modal .modal-dialog {
    max-width: 85vw;
}

#crop-modal .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#crop-modal .modal-header {
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#crop-modal .modal-footer {
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #dee2e6;
}

#crop-container {
    border: 2px dashed #dee2e6;
    transition: border-color 0.3s ease;
    background-color: #f8f9fa;
}

#crop-container:hover {
    border-color: #007bff;
}

/* Custom range slider styling */
#zoom-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    transition: background 0.3s ease;
}

#zoom-slider:hover {
    background: #bbb;
}

#zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

#zoom-slider::-webkit-slider-thumb:hover {
    background: #0056b3;
}

#zoom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Croppie enhancements */
.cr-boundary {
    border-radius: 8px;
    overflow: hidden;
}

.cr-viewport {
    border: 3px solid #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.cr-slider-wrap {
    margin-top: 15px;
}

/* Button enhancements for crop modal */
#crop-modal .btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#crop-modal .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#crop-modal .card {
    border-radius: 8px;
}

#crop-modal .card-header {
    border-radius: 8px 8px 0 0;
}

/* Enhanced controls styling */
.controls-section {
    border-top: 1px solid #f1f3f4;
    padding-top: 1rem;
}

.controls-section .form-label {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Improved button styling for rotation controls */
#crop-modal .btn-group .btn {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ---------------------- */
/* Mobile Croppie Tuning  */
/* ---------------------- */
/* Make modal more usable on narrow / short viewports */
#crop-modal .modal-content {
    max-height: 100vh;            /* Never exceed viewport height */
    display: flex;
    flex-direction: column;       /* Allow body to scroll while header/footer stay fixed */
}

#crop-modal .modal-body {
    overflow-y: auto;             /* Scroll interior if content taller than viewport */
}

/* Constrain croppie boundary on any screen to avoid overflows */
#crop-modal .cr-boundary {
    max-height: 65vh;             /* Leave room for header/footer */
}

/* Extra refinements specifically for small devices */
@media (max-width: 575.98px) {
    #crop-modal .modal-dialog {
        max-width: 100%;
        margin: .75rem;           /* Reduce side margins */
    }
    #crop-modal .modal-header, #crop-modal .modal-footer {
        padding: .6rem .9rem;     /* Slightly tighter chrome */
    }
    #crop-modal .modal-title {
        font-size: 1rem;
    }
    #crop-modal .modal-body {
        padding: 0.85rem 0.85rem 1rem;
        max-height: calc(100vh - 6.5rem); /* Header + footer reserved space */
    }
    /* Stack columns (cropper + preview) vertically */
    #crop-modal .modal-body .row {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin: 0;                 /* Remove Bootstrap negative gutter offsets */
    }
    #crop-modal .modal-body [class*="col-md"] {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0;                /* Tighter spacing */
    }
    /* Crop area should scale to width and limit height */
    #crop-modal .cr-boundary {
        width: 100% !important;
        max-height: 55vh;          /* Smaller on phones */
    }
    /* Live preview sizing */
    .luminaria-preview {
        width: 80%;
        max-width: 320px;
        margin: 0 auto 1rem;
    }
    /* Ensure slider / controls don't wrap awkwardly */
    #crop-modal .cr-slider-wrap {
        padding: 0 .25rem;
    }
    #crop-modal .btn-group .btn {
        font-size: 0.7rem;
        padding: .35rem .45rem;
    }
}

/* Slightly wider small tablets */
@media (min-width: 576px) and (max-width: 767.98px) {
    #crop-modal .cr-boundary { max-height: 60vh; }
}

/* Landscape phones: increase height a bit if width is ample */
@media (max-height: 500px) and (orientation: landscape) {
    #crop-modal .cr-boundary { max-height: 50vh; }
    #crop-modal .modal-body { max-height: calc(100vh - 5.5rem); }
}
