/* Custom styles beyond Tailwind */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Pentru Chrome, Edge, Safari */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Pentru Firefox */
input[type=number] {
  -moz-appearance: textfield;
}


/* Animation for notifications */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Custom form styles */
.form-input:focus {
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.25);
}

/* Custom loading spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid #0ea5e9;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Multi-column form layout for wide screens */
@media (min-width: 768px) {
    .form-2-cols {
        column-count: 2;
        column-gap: 2rem;
    }
    
    .form-3-cols {
        column-count: 3;
        column-gap: 2rem;
    }
}

/* Custom card hover effect */
.hover-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

html, body { margin: 0; padding: 0; }
body { padding-top: 0 !important; }

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Print styles */
@media print {
    header, footer, nav, .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
    }
    
    .print-full-width {
        width: 100% !important;
    }
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: none;
}

/* Custom styles for select elements */
li.select2-results__option.select2-results__message {
    font-size: 14px !important;
    color: #4e4e4e;
    font-weight: 500;
}

input.select2-search__field:focus {
    outline: none !important;
}

input.select2-search__field {
    font-size: 0.875rem;
    line-height: 1.25rem;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-color: rgb(229 231 235 / 1);
    border-radius: 0.5rem;
}

span.select2-selection.select2-selection--single {
    border-color: rgb(229 231 235 / 1) !important;
    border-radius: 0.5rem !important;
    min-height: 34px !important;
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #444;
    line-height: 1.25rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

span.select2-dropdown {
    border: none !important;
    padding: 2px;
    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
    border-radius: 0.5rem !important;
    margin-top: 5px;
}

li.select2-results__option.select2-results__option--selectable {
    margin: 0px 3px 0px 3px !important;
    border-radius: 0.5rem !important;
}

.select2-container--open span.select2-selection.select2-selection--single {
    border-color: #2563eb ! IMPORTANT;
    border-width: 2px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 3px !important;
    right: 4px !important;
    z-index: 90 !important;
}

button.select2-selection__clear {
    margin: 2px 0px 0px 0px !important;
    right: 10px;
    position: absolute;
    top: 1px;
    background-color: white !important;
    padding: 0px;
    height: 20px !important;
    z-index: 99 !important;
}

/* Prevent page scrollbar when Select2 dropdowns are open */
body.is-select2-open {
    overflow: hidden;
}
html.is-select2-open {
    overflow: hidden;
}

.constructor .select2-container--default .select2-results__option--disabled {
    font-weight: 600;
    color: #000 ! IMPORTANT;
    font-size: 14px;
    text-transform: uppercase;
}

/* Select2 - multiselect */
li.select2-selection__choice {
    margin: 0px !important;
    background-color: #f9f9f9 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.375rem !important;
    height: 20px;
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem !important;
    padding-top: 0.375rem !important;
    padding-bottom: 0.375rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    display: flex !important;
}

textarea.select2-search__field {
    margin: 0px !important;
    padding: 0px !important;
}


.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    color: #979797 !important;
}

.select2-selection__choice__display {
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    display: flex !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    border-right: 1px solid #e5e7eb !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    top: -1px !important;
}

.select2-container .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    gap: 5px;
}

span.select2-selection.select2-selection--multiple {
    display: flex !important;
    align-items: center;
    align-content: center;
    flex-wrap: nowrap !important;
}

span.select2-search.select2-search--inline {
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
}

ul#select2-allowed-body-styles-container {
    display: flex !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove span {
    font-size: 12px !important;
    line-height: 1.25rem !important;
}


button.select2-selection__clear span {
    font-size: 11px;
    line-height: 1rem;
    color: #888888;
}

button.select2-selection__clear {
    background-color: #f1f1f1 !important;
    border: 1px solid #e9e9e9 !important;
    padding: 2px !important;
    margin: 0px !important;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 12px !important;
    height: 12px !important;
    border-radius: 50px;
    line-height: 8px;
    font-size: 7px !important;
    top: 10px;
    right: 3px !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable .set-data {
    color: #c3daff !important;
    font-weight: 700 !important;
}

/* Debug Popup Styles */
.debug-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

.debug-content {
    line-height: 1.6 !important;
    font-size: 14px !important;
}

.debug-content h2 {
    margin-bottom: 20px !important;
    color: #2563eb !important;
    font-size: 20px !important;
    font-weight: 600 !important;
}

.debug-content h3 {
    margin: 0 0 10px 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.debug-content p {
    margin: 5px 0 !important;
    font-size: 14px !important;
}

.debug-content pre {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 4px !important;
    padding: 10px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    overflow-x: auto !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}

/* Logo Selection Styles */
#cfg-preview-block-svgs svg path {
    transition: opacity 0.2s ease;
}

#cfg-preview-block-svgs svg path.restricted {
    opacity: 0.8 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

#cfg-preview-block-svgs svg path:not(.restricted) {
    opacity: 1;
}

/* Logo badge animation */
#cfg-preview-block-svgs svg g[data-logo-badge] {
    animation: logoFadeIn 0.3s ease-in-out;
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Sweetalert - toast style */
div#swal2-html-container {
    padding: 0px !important;
    margin: 0px !important;
    font-size: 0.825rem !important;
    line-height: 1rem !important;
}

div:where(.swal2-container) div:where(.swal2-timer-progress-bar)
{
    background: rgb(239 239 239);
}

h2#swal2-title {
    padding: 0px !important;
    margin: 0px !important;
}

.swal2-html-container {
    display: flex !important;
    justify-content: center !important;
}

.swal2-top-end .swal2-html-container {
    display: flex !important;
    justify-content: flex-start !important;
}

.swal2-modal {
    border-radius: 1rem !important;
}

/* Admin table/card consistency */
.category-panel--table,
.bg-white.rounded-lg,
.bg-white.rounded-xl,
.bg-white.shadow,
.bg-white.shadow-sm {
    min-height: 0;
}

.category-table-wrap,
.overflow-x-auto,
.overflow-auto {
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
    min-height: 0;
}

.category-table-wrap > table,
.overflow-x-auto > table,
.overflow-auto > table {
    height: auto !important;
}

/* Project categories input */
#projectCategoryName {
    width: 100%;
    min-height: 40px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #fff;
    color: #111827;
    font-size: 0.875rem;
    line-height: 1.25rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#projectCategoryName::placeholder {
    color: #9ca3af;
}

#projectCategoryName:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
