.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: linear-gradient(to right, #2c3e50, #3498db);
    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: linear-gradient(to right, #2c3e50, #3498db);
    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;
}

.input-group {
    width: 300px;
}

.form-control {
    background-color: rgba(236, 240, 241, 0.1);
    color: #2c3e50; /* Dark color for better visibility */
}

.form-control:focus {
    background-color: rgba(236, 240, 241, 0.2);
    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 */
}

.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: none;
}
.lum-photo-card {
    border-radius:4%;
    width:70%;
    height:70%;
    position:absolute;
    top:10%;
    left:17%;
    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-weight: 600;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.75rem;
    display: inline-block;
}

.luminaria-story-text {
    font-family: 'Merienda One', cursive;
    font-size: calc(1.2rem + 2vmin);
    line-height: 1.8;
    color: #34495e;
}

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

.luminaria-meta p {
    margin-bottom: 0.5rem;
}

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

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

.event-link:hover {
    color: #764ba2;
    text-decoration: underline;
}
body {
    background-color: #FCFCFC;
}

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

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

/* Smooth fade-in animation for cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Staggered animation delays for cards */
.card {
    animation: fadeInUp 0.8s ease-out forwards;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    border: none;
    margin-bottom: 1.5rem;
}

.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.2s;
}

.card:nth-child(3) {
    animation-delay: 0.3s;
}

.card:nth-child(4) {
    animation-delay: 0.4s;
}

.card:nth-child(5) {
    animation-delay: 0.5s;
}

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

/* 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: #667eea;
    font-weight: 600;
}

/* Enhanced links */
.card-body a {
    color: #667eea;
    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: #764ba2;
    border-bottom-color: #764ba2;
    text-decoration: none;
}

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

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

/* Links within text should be more visible */
p a, .lead a {
    color: #667eea;
    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: #764ba2;
    border-bottom-color: #764ba2;
    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: #667eea;
    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: #764ba2;
    border-bottom-color: #764ba2;
}

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

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    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 luminaria grid cards */
.col-sm-6 .card {
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out backwards;
}

/* Staggered animation for luminaria cards */
.col-sm-6:nth-child(1) .card {
    animation-delay: 0.1s;
}

.col-sm-6:nth-child(2) .card {
    animation-delay: 0.15s;
}

.col-sm-6:nth-child(3) .card {
    animation-delay: 0.2s;
}

.col-sm-6:nth-child(4) .card {
    animation-delay: 0.25s;
}

.col-sm-6:nth-child(5) .card {
    animation-delay: 0.3s;
}

.col-sm-6:nth-child(6) .card {
    animation-delay: 0.35s;
}

.col-sm-6 .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.25);
}

.col-sm-6 .card-body {
    padding: 1.25rem;
}

.col-sm-6 .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.col-sm-6 .card-text {
    line-height: 1.6;
}

.col-sm-6 .card-text small {
    font-size: 0.875rem;
}

.col-sm-6 .card img {
    transition: transform 0.4s ease;
}

.col-sm-6 .card:hover img {
    transform: scale(1.05);
}

/* Enhanced blockquotes */
blockquote {
    transition: transform 0.3s ease;
}

blockquote:hover {
    transform: scale(1.01);
}

/* Smooth list animations */
ul {
    list-style: none;
    padding-left: 0;
}

/* Exclude Select2 and other UI component list items from custom styling */
ul li:not(.select2-results__option):not(.nav-item):not(.list-group-item):not(.dropdown-item) {
    position: relative;
    padding-left: 1.8rem;
    margin-bottom: 1rem;
    line-height: 1.7;
    transition: transform 0.2s ease;
}

ul li:not(.select2-results__option):not(.nav-item):not(.list-group-item):not(.dropdown-item):hover {
    transform: translateX(4px);
}

/* Exclude Select2 dropdowns, navigation menus, and other UI elements from arrow styling */
ul li:not(.select2-results__option):not(.nav-item):not(.list-group-item):not(.dropdown-item):before {
    content: "→";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

ul li:not(.select2-results__option):not(.nav-item):not(.list-group-item):not(.dropdown-item):hover:before {
    transform: translateX(4px);
}

/* Special styling for alert lists */
.alert ul li {
    padding-left: 1.5rem;
}

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

/* Enhanced pagination */
.pagination {
    animation: fadeIn 0.6s ease-out;
}

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

.page-link:hover {
    background-color: #667eea;
    border-color: #667eea;
    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: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    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: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 60px;
        opacity: 1;
    }
}

/* 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 */
}
#goal {
    font-size: calc(1.2rem + 2vmin);
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 1rem;
    animation: fadeIn 1s ease-out;
}
#glass {
    width: 100%;
    background: linear-gradient(90deg, #e8dff0 0%, #dccde4 100%);
    height: 28px;
    border-radius: 14px;
    float: left;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

#glass:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
    border-radius: 14px 14px 0 0;
}

#glass .progress-bar {
    animation: progressFill 2s ease-out forwards;
    box-shadow: 0 0 10px rgba(95, 9, 175, 0.4);
    position: relative;
    overflow: visible;
}

#glass .progress-bar:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.2) 50%,
        transparent 100%);
    animation: shimmerProgress 2s infinite;
}

@keyframes progressFill {
    from {
        width: 0 !important;
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes shimmerProgress {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.goal-stat {
    padding: 1rem;
    text-align: center;
    animation: fadeInUp 1.2s ease-out;
}
.goal-number, .goal-label {
    display: block;
}
.goal-number {
    font-weight: bold;
    color: #667eea;
    font-size: 1.2rem;
}

/* Share Card Gradient Styling */
.share-card-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    border-radius: 1.5rem;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    animation: gradientShift 8s ease infinite;
}

/* Subtle gradient animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Add a subtle overlay shimmer effect */
.share-card-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 6s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Fade in animation for share card content */
.share-card-content {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.share-card-content:not(.d-none) {
    opacity: 1;
}

/* Share icon wrapper with pulse animation */
.share-icon-wrapper {
    display: inline-block;
    animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

.share-icon-wrapper:hover .share-icon {
    transform: rotate(15deg) scale(1.1);
}

/* 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: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: #667eea;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.share-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.4s ease;
    z-index: -1;
}

.share-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.3);
    color: white;
}

.share-button:hover::before {
    width: 100%;
}

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

.share-button i {
    transition: transform 0.3s ease;
}

.share-button:hover i {
    transform: translateX(-3px);
}

/* 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;
    }
}

.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;
}

.tips-section {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 0.75rem;
    border-left: 3px solid #007bff;
}

.tips-section ul li {
    font-size: 0.8rem;
    color: #6c757d;
}

/* 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); }
}

