﻿/* Card animation classes*/
.auth-animation {
    animation: fadeIn 0.8s ease-in-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.kanban-card.is-loading {
    opacity: 0.6; 
    background-color: #f9fafb;
    pointer-events: none; 
    position: relative;
}

.kanban-card.is-loading::after {
    content: '';
    position: absolute;
    opacity:1 !important;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db; 
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* sidebar active color */
.sidebarActive {
    background-color: rgb(243 244 246) !important;
}


[type=checkbox]:focus, [type=radio]:focus {
    --tw-ring-color: #2cb0f2 !important; 
    outline: none !important;
}

.select2 select2-container select2-container--default{
    width:auto !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {    
    margin-right: 10px !important;
}

/* Override default Select2 single select look */
.select2-container--default .select2-selection--single {
    border: 2px solid #f3f4f6 !important;
    border-radius: 0.375rem;
    padding: 0.5rem;
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    height: 44px !important;
    display: flex !important;
    width: 100% !important;
    align-items: center !important;
}

#kpi-summary-form .select2-container--default {
    max-width: 250px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #2cb0f2 !important;
    border-color: transparent !important;
    color: white !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white !important;
    border-color: transparent !important;
}

.select2-container .select2-search--inline .select2-search__field{
    height:22px !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background-color: #008acf !important;
}
/* Override default Select2 multiple select look */
.select2-container--default .select2-selection--multiple {
    border: 2px solid #f3f4f6 !important;
    border-radius: 0.375rem;
    padding: 0.3rem !important;
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    min-height:44px !important;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex !important;
    width: 100% !important;
    align-items: center !important;
}

.select2-container .select2-search--inline .select2-search__field {
    vertical-align: middle !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
}

.select2-container--default .select2-selection--multiple {
    padding: 0.25rem;
    padding-bottom:0.5rem !important;
}

.select2-container--default{
        width:100% !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #2cb0f2 !important;
    color: white;
}

.select2-container--default .select2-selection--single:hover {
    background-color: #f9fafb; 
}

.select2-container--default .select2-selection--single:focus {
    background-color: #ffffff;
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px #2cb0f2;
}


.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #374151; 
    padding-left: 0 !important; 
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 50% !important;
    transform: translateY(-50%);
    right: 0.75rem; 
}

.select2-results__option {
    padding: 4px 8px; /* Reduce padding */
    font-size: 16px; /* Optional: Smaller text */
    line-height: 2; /* Tighter line spacing */
}

/* Validation classes */
input.valid-input {
    padding-right: 2.5rem;
    background-image: url('/images/icon-check.svg');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.2rem;
}

input.valid-input-ar {
    background-image: url('/images/icon-check.svg');
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 1.2rem;
}

input.invalid-input {
    border-color: #dc3545;
}

select.valid-input {
    padding-right: 2.5rem;
    background-image: url('/images/icon-check.svg');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.2rem;
}

select.valid-input-ar {
    padding-right: 2.5rem;
    background-image: url('/images/icon-check.svg');
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 1.2rem;
}

select.invalid-input {
    border-color: #dc3545;
}

.validation-error {
    color: #dc3545;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

.required-field::after {
    content: '*';
    color: red;
    margin-left: 5px;
}
.input-wide {
    width: 380px;
    max-width: 100%;
}

/** Fixed Loader Styles */
.ace-loader-wrap {
    width: 160px; /* Consistent size */
    height: 160px;
    display: grid;
    place-items: center;
    transform: scale(.96);
    will-change: transform, opacity;
}

.ace-loader-wrap svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.ace-sr {
    position: absolute;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
}

/* UNDERLAY: thinner stroke for subtle contrast */
.ace-trace-under {
    vector-effect: non-scaling-stroke;
    fill: none;
    stroke: rgb(44 176 242 / 0.25); /* Reduced opacity and thickness */
    stroke-width: 1px; /* Much thinner */
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: var(--len, 300);
    stroke-dashoffset: var(--len, 300);
    animation: ace-trace var(--dur, 1600ms) ease-in-out var(--delay, 0ms) infinite alternate;
}

/* MAIN stroke on top - much thinner */
.ace-trace-shape {
    vector-effect: non-scaling-stroke;
    fill: none !important;
    stroke: #2CB0F2 !important;
    filter: url(#ace-glow-strong) drop-shadow(0 0 3px rgba(44,176,242,.5)); /* Reduced glow */
    stroke-width: 0.5px; /* Much thinner main stroke */
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: var(--len, 300);
    stroke-dashoffset: var(--len, 300);
    animation: ace-trace var(--dur, 1600ms) ease-in-out var(--delay, 0ms) infinite alternate;
}

@keyframes ace-trace {
    to {
        stroke-dashoffset: 0;
    }
}

/* Overlay styles */
.ace-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: grid;
    place-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity .25s ease, visibility .25s ease;
}

.loader-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.ace-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 28, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ace-overlay-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(40% 40% at 50% 45%, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 60%), radial-gradient(65% 65% at 50% 50%, rgba(0,0,0,.12) 0%, rgba(0,0,0,0) 60%);
    pointer-events: none;
}

.ace-overlay-body {
    position: relative;
    display: grid;
    place-items: center;
    gap: 16px;
    width: min(260px, 56vw);
    aspect-ratio: 1 / 1;
    padding: 20px;
    border-radius: 22px;
    background: rgba(20, 24, 35, 0.28);
    box-shadow: 0 10px 35px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.08);
    backdrop-filter: blur(10px) saturate(115%);
    -webkit-backdrop-filter: blur(10px) saturate(115%);
    transform: translateY(2px) scale(.985);
    opacity: .98;
    transition: transform .3s ease, opacity .3s ease;
}

.ace-overlay:not(.loader-hidden) .ace-overlay-body {
    transform: translateY(0) scale(1);
    opacity: 1;
    animation: ace-breathe 2.4s ease-in-out .3s infinite;
}

.ace-overlay:not(.loader-hidden) .ace-loader-wrap {
    animation: ace-breathe 2.4s ease-in-out .3s infinite;
}

@keyframes ace-breathe {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.012); /* Subtler breathing */
    }
}

.ace-loading-text {
    font: 500 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans";
    color: rgba(255,255,255,.9);
    letter-spacing: .3px;
    text-align: center;
    user-select: none;
    min-height: 20px; /* Prevent layout shift */
}

.ace-loading-text .ace-dots {
    display: inline-flex;
    gap: 4px;
    margin-inline-start: 6px;
}

.ace-loading-text .ace-dots i {
    display: inline-block;
    width: .35em;
    height: .35em;
    border-radius: 50%;
    background: rgb(44 176 242 / 1);
    opacity: .5;
    transform: translateY(0);
    animation: ace-dot 1.4s infinite ease-in-out;
}

.ace-loading-text .ace-dots i:nth-child(2) {
    animation-delay: .2s;
}

.ace-loading-text .ace-dots i:nth-child(3) {
    animation-delay: .4s;
}

@keyframes ace-dot {
    0%, 80%, 100% {
        opacity: .4;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* Logo styling */
#ace-logo text,
#ace-logo .ace-logo-text,
#ace-logo path[fill]:not(.ace-trace-shape):not(.ace-trace-under) {
    fill: #ffffff !important;
    filter: drop-shadow(0 0 3px rgba(44,176,242,0.5));
}

#ace-logo [fill]:not([fill="none"]):not(.ace-trace-shape):not(.ace-trace-under) {
    fill: #fff !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ace-loader-wrap {
        width: 140px;
        height: 140px;
    }

    .ace-overlay-body {
        width: min(220px, 70vw);
        padding: 16px;
        gap: 14px;
    }

    .ace-loading-text {
        font-size: 13px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .ace-trace-under,
    .ace-trace-shape {
        animation-duration: 2s;
    }

    .ace-overlay-body,
    .ace-loader-wrap {
        animation: none;
    }

    .ace-loading-text .ace-dots i {
        animation: none;
        opacity: .7;
    }
}

.nav-profile-container i {
    transform: translateY(0);
    transition: transform 0.2s ease-in; /* slow ease on unhover */
}

.nav-profile-container:hover i {
    transform: translateY(4px);
    transition: transform 0.15s ease-out; /* faster ease on hover */
}

.start-aligned-button {
    position: relative;
    overflow: hidden; /* keep gloss inside the button */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.start-aligned-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient( 120deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 60%, transparent 100% );
    transform: skewX(-20deg);
    transition: left 0.4s ease-in-out;
}

input:focus-visible {
    outline: none;
}

[multiple]:focus, [type=date]:focus, [type=datetime-local]:focus, [type=email]:focus, [type=month]:focus, [type=number]:focus, [type=password]:focus, [type=search]:focus, [type=tel]:focus, [type=text]:focus, [type=time]:focus, [type=url]:focus, [type=week]:focus, select:focus, textarea:focus {
    --tw-ring-color: white !important; /* example: Tailwind orange-500 */
    box-shadow: none !important; /* remove default ring shadow */
    outline: none !important; /* remove extra outline */
    border-color: #2CB0F2 !important
}

.start-aligned-button:hover::before {
    left: 125%; /* swipe across button */
}

body {
    font-size: 1rem;
}

@media (max-width: 600px) {
    body {
        font-size:0.8rem;
    }
}
/* ==========================
   Payment Status Badges
   ========================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem; /* px-2 py-1 */
    font-size: 0.75rem; /* text-xs */
    font-weight: 600;
    border-radius: 9999px; /* rounded-full */
    border: 1px solid transparent;
    white-space: nowrap;
}

/* Variants */
.badge-green {
    color: #166534; /* text-green-800 */
    background-color: #bbf7d0; /* bg-green-100 */
    border-color: #22c55e; /* border-green-500 */
}

.badge-yellow {
    color: #92400e; /* text-yellow-800 */
    background-color: #fef3c7; /* bg-yellow-100 */
    border-color: #f59e0b; /* border-yellow-500 */
}

.badge-red {
    color: #991b1b; /* text-red-800 */
    background-color: #fecaca; /* bg-red-200 */
    border-color: #ef4444; /* border-red-500 */
}

.badge-blue {
    color: #1e3a8a; /* text-blue-800 */
    background-color: #bfdbfe; /* bg-blue-200 */
    border-color: #3b82f6; /* border-blue-500 */
}

.badge-purple {
    color: #6b21a8; /* text-purple-800 */
    background-color: #e9d5ff; /* bg-purple-200 */
    border-color: #a855f7; /* border-purple-500 */
}

.badge-gray {
    color: #374151; /* text-gray-700 */
    background-color: #e5e7eb; /* bg-gray-200 */
    border-color: #6b7280; /* border-gray-500 */
}

.badge-indigo {
    color: #3730a3; /* text-indigo-700 */
    background-color: #e0e7ff; /* bg-indigo-100 */
    border-color: #6366f1; /* border-indigo-500 */
}

.badge-sky {
    color: #0369a1; /* text-sky-700 */
    background-color: #e0f2f1; /* bg-sky-100 (Lighter blue/teal shade) */
    border-color: #0ea5e9; /* border-sky-500 */
}

#paymentSelect {
    width: 100% !important;
}

.select2-container {
    width: 100% !important;
}

.select2-dropdown {
    z-index: 1060;
}

.select2-ats .select2-selection--single {
    height: 44px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0 .75rem;
    background: #fff;
}

.select2-ats .select2-selection__rendered {
    line-height: 44px;
}

.select2-ats .select2-selection__arrow {
    height: 44px;
    right: .5rem;
}
.shared-table-container,
.shared-index-container {
    max-height: none !important;
    overflow-y: visible !important;
}

#responsesTableBody .shared-table th, #responsesTableBody .shared-table td {
    white-space: normal;
    word-break: break-word;
}
input[data-maxed="true"] {
    background-color: #fff5f5;
    border-color: #ef4444;
}
.group:hover .tooltip {
    display: block;
}

.tooltip {
    white-space: normal;
    line-height: 1.4;
}
.shared-index-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.shared-search-form-container {
    flex: 1;
    min-width: 250px;
}

.start-aligned-button {
    white-space: nowrap;
    flex-shrink: 0;
}
#detailsModal > div {
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

#detailsModal:not(.hidden) > div {
    transform: translateY(0);
    opacity: 1;
}
input:invalid {
    border-color: #e11d48; /* red */
}
