/* Premium Base & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --glass-bg: rgba(20, 15, 10, 0.45);
    --glass-border: rgba(255, 165, 0, 0.15);
    --glass-highlight: rgba(255, 255, 255, 0.12);

    --accent-orange: #FF8C00;
    --accent-amber: #FFBF00;
    --accent-red: #FF4500;
    --accent-gold: #D4AF37;

    --text-main: #FFF4E5;
    --text-muted: #D1A684;

    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(255, 140, 0, 0.35);
}

body {
    background-color: transparent;
    color: var(--text-main);
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 12px;
    user-select: none;
    cursor: default;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 140, 0, 0.25) transparent;
}

/* Animated Ambient Background for Premium Feel */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 140, 0, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(255, 69, 0, 0.03) 0%, transparent 30%);
    pointer-events: none;
    z-index: -1;
    animation: pulseAmbient 15s ease-in-out infinite alternate;
}

@keyframes pulseAmbient {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.1) translate(-2%, 2%);
    }
}

/* Layout - Ultra Compact */
.panel-wrapper {
    padding: 10px 8px;
    display: block; /* Safer than flex if gap is an issue */
    min-height: 100vh;
    background-color: #120e0a; /* Fallback for PS 2019 / older CEF */
    background: linear-gradient(180deg, #16120e 0%, #0f0b08 100%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
}

.action-group, .preset-group {
    margin-bottom: 5px !important;
}

.panel-wrapper > *:last-child {
    margin-bottom: 0 !important;
}

/* Header - Aesthetic & Compact */
.panel-header {
    text-align: center;
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 2px;
}

.panel-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    width: 70%;
    height: 1px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 80%);
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 200;
    font-size: 20px;
    letter-spacing: 4px;
    color: #ffffff;
    margin-bottom: 2px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.logo .highlight {
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 0%, #7db9e8 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 5s linear infinite;
    margin-left: 2px;
}

@keyframes shine {
    to { background-position: 200% center; }
}

/* Header - Remarquable Orange Style */
.panel-header {
    text-align: center;
    position: relative;
    padding: 16px 12px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.25) 0%, rgba(204, 85, 0, 0.15) 100%);
    border-radius: 10px;
    border: 1px solid rgba(255, 180, 0, 0.3);
    box-shadow: inset 0 0 20px rgba(255, 140, 0, 0.1), 0 4px 15px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.settings-btn {
    position: absolute;
    top: 6px;
    left: 10px;
    transform: none;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 3px 5px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, box-shadow 0.2s;
    z-index: 10;
    line-height: 1;
}

.settings-btn:hover {
    opacity: 1;
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.5);
    border-color: rgba(255, 165, 0, 0.5);
}

.panel-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.2) 0%, transparent 60%);
    animation: pulseHeader 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes pulseHeader {
    from { transform: scale(1); opacity: 0.5; }
    to { transform: scale(1.2); opacity: 0.8; }
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: 20px;
    letter-spacing: 5px;
    color: #ffffff;
    margin-bottom: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.logo .highlight {
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 0%, #ffcc33 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 6s linear infinite;
    text-shadow: 0 0 15px rgba(255, 165, 0, 0.5);
    margin-left: 2px;
}

@keyframes shine {
    to { background-position: 200% center; }
}

.subtitle {
    font-family: 'Syncopate', sans-serif;
    font-size: 7.5px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #ffd8a8;
    text-transform: uppercase;
    opacity: 0.9;
    display: block;
    position: relative;
    z-index: 2;
}

/* Sections - Compact */
.action-group {
    display: flex;
    flex-direction: column;
}

/* Presets Grid - Premium Portrait Style */
.preset-group {
    display: flex;
    flex-direction: column;
    padding-bottom: 8px;
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(255, 140, 0, 0.1);
}

.preset-group > *:first-child {
    margin-bottom: 8px;
}

.preset-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin: -4px !important;
}

.preset-btn {
    width: calc(20% - 8px) !important;
    margin: 4px !important;
    margin-bottom: 4px !important;
    position: relative;
    background: var(--glass-highlight);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 5;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.preset-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.preset-btn:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.preset-btn:hover img {
    transform: scale(1.1);
}

.preset-btn:active {
    transform: scale(0.95);
    transition: all 0.1s;
}

/* Glass Overlay on Preset Buttons */
.preset-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.4));
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.preset-btn:hover::after {
    opacity: 0.2;
}

/* Grids */
.grid-3 {
    display: flex;
    flex-wrap: wrap;
    margin: -4px !important;
}

.grid-3 > .action-btn {
    width: calc(33.33% - 6px) !important;
    margin: 3px !important;
    margin-bottom: 4px !important;
}

.grid-1 {
    display: block;
}

.grid-1 > .action-btn {
    width: 100% !important;
    margin-bottom: 4px !important;
}

/* Premium Buttons */
.action-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 5px 8px;
    display: flex;
    flex-direction: row;      /* Icon left, label right */
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    min-height: 42px;
}

.action-btn .icon {
    margin-right: 6px;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: skewX(-25deg);
    transition: all 0.6s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.action-btn:hover::before {
    left: 200%;
}

.action-btn:active {
    transform: translateY(1px);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.3);
    border-color: var(--glass-border);
    transition: all 0.1s;
}

/* Distinct Button Styles - Orange/Amber Shades */
.btn-primary {
    background: linear-gradient(145deg, rgba(255, 140, 0, 0.15), rgba(139, 69, 19, 0.05));
    border-color: rgba(255, 140, 0, 0.35);
    color: #ffd8a8;
}

.btn-primary:hover {
    background: linear-gradient(145deg, rgba(255, 140, 0, 0.25), rgba(139, 69, 19, 0.1));
    border-color: rgba(255, 140, 0, 0.6);
    box-shadow: var(--shadow-glow), var(--shadow-soft);
}

.btn-accent {
    background: linear-gradient(145deg, rgba(255, 191, 0, 0.12), rgba(139, 69, 19, 0.05));
    border-color: rgba(255, 191, 0, 0.3);
    color: #fff4e5;
    padding: 5px 8px;
    justify-content: flex-start;
}

.btn-accent:hover {
    background: linear-gradient(145deg, rgba(255, 191, 0, 0.2), rgba(139, 69, 19, 0.1));
    border-color: rgba(255, 191, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 191, 0, 0.25), var(--shadow-soft);
}

.btn-export {
    background: linear-gradient(145deg, rgba(255, 69, 0, 0.15), rgba(139, 0, 0, 0.05));
    border-color: rgba(255, 69, 0, 0.4);
    color: #ffccbc;
    padding: 5px 8px;
    justify-content: flex-start;
}

.btn-export:hover {
    background: linear-gradient(145deg, rgba(255, 69, 0, 0.25), rgba(139, 0, 0, 0.1));
    border-color: rgba(255, 69, 0, 0.6);
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.25), var(--shadow-soft);
}

/* Inner elements */
.action-btn .icon {
    font-size: 14px;
    opacity: 0.85;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    text-align: center;
}

.action-btn:hover .icon {
    opacity: 1;
    transform: scale(1.1);
}

.action-btn .label {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: all 0.3s;
    text-transform: uppercase;
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
}

.btn-accent .icon,
.btn-export .icon {
    font-size: 14px;
}

/* Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    transition: all 0.3s ease;
}

.settings-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

.settings-content {
    background-color: #14110f; /* Fallback for PS 2019 */
    background: linear-gradient(145deg, rgba(20, 15, 10, 0.98), rgba(10, 7, 5, 0.99));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    width: 100%;
    max-width: 260px;
    max-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    overflow: hidden;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.settings-header {
    padding: 12px 16px;
    background: rgba(255, 140, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.settings-header h3 {
    font-size: 10px;
    letter-spacing: 2px;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
}

.settings-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.settings-body > *:not(:last-child) {
    margin-bottom: 14px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group > *:not(:last-child) {
    margin-bottom: 6px;
}

.input-group label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.toggle-group {
    display: flex;
    font-size: 11px;
}

.toggle-group > *:not(:last-child) {
    margin-right: 15px;
}

input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    padding: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--accent-orange);
    background: rgba(255, 255, 255, 0.08);
}

.sub-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
}

.path-text {
    font-size: 8px;
    color: var(--text-muted);
    word-break: break-all;
    margin: 0;
}

#image-path-display {
    text-align: center;
    margin-top: 4px;
}

.save-btn {
    background: var(--accent-orange);
    border: none;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 4px;
    transition: 0.3s;
}

.save-btn:hover {
    filter: brightness(1.2);
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.4);
}

.hidden { display: none !important; }

/* Notification System - Premium Toasts */
#notification-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    z-index: 9999;
    pointer-events: none;
}

#notification-container > *:not(:last-child) {
    margin-bottom: 10px;
}

.toast {
    padding: 12px 16px;
    background: rgba(20, 15, 10, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,140,0,0.1);
    animation: toastSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1), toastFadeOut 0.5s 3.5s forwards;
    pointer-events: auto;
    max-width: 100%;
}

.toast .toast-icon {
    margin-right: 12px;
}

.toast.success {
    border-color: rgba(255, 140, 0, 0.6);
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.15) 0%, rgba(20, 15, 10, 0.95) 100%);
}

.toast.error {
    border-color: rgba(255, 69, 0, 0.6);
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.15) 0%, rgba(20, 15, 10, 0.95) 100%);
}

.toast-icon {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.success .toast-icon::before { content: '✅'; }
.toast.error .toast-icon::before { content: '⚠️'; }

@keyframes toastSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes toastFadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* Custom large modal and square thumbnail grids */
.modal-large {
    max-width: 270px;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 8px;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
    margin-top: 5px;
}

.thumbnail-grid::-webkit-scrollbar {
    width: 4px;
}
.thumbnail-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}
.thumbnail-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 140, 0, 0.3);
    border-radius: 4px;
}
.thumbnail-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 140, 0, 0.6);
}

.thumbnail-item {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.thumbnail-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-orange);
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.3);
}

.thumbnail-item:hover img {
    transform: scale(1.1);
}

.lut-item {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.08) 0%, rgba(20, 15, 10, 0.4) 100%);
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    text-align: center;
    box-sizing: border-box;
}

.lut-item .lut-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    margin-bottom: 6px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, #13f1fc, #0470dc); /* valeur par défaut */
    transition: all 0.3s ease;
}

.lut-item .lut-name {
    font-size: 7.5px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--text-main);
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lut-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-amber);
    background: linear-gradient(135deg, rgba(255, 191, 0, 0.15) 0%, rgba(255, 140, 0, 0.05) 100%);
    box-shadow: 0 0 12px rgba(255, 191, 0, 0.35);
}

/* Horizontal Carousel Styles */
.carousel-wrapper {
    position: relative;
    width: 100%;
    display: block;
    padding: 0;
}

.carousel-container {
    overflow: hidden;
    width: 100%;
    height: 162px;
}

.carousel-track {
    display: grid;
    grid-template-rows: repeat(2, 75px);
    grid-auto-flow: column;
    grid-auto-columns: 60px;
    grid-gap: 8px;
    gap: 8px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.carousel-track .preset-btn {
    flex: 0 0 60px !important;
    width: 60px !important;
    height: 75px !important;
    margin: 0 !important;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.carousel-arrow {
    position: absolute;
    top: 0;
    height: 100%;
    width: 28px;
    z-index: 10;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    line-height: 1;
}

#carousel-prev {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.65) 0%, transparent 100%);
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

#carousel-next {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.65) 0%, transparent 100%);
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.carousel-arrow:hover {
    opacity: 1.0;
    color: var(--accent-orange);
}

.carousel-arrow:active {
    transform: scale(0.9);
}

.carousel-add-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--glass-border);
    color: var(--text-muted);
    font-size: 18px;
    width: 60px !important;
    height: 75px !important;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.carousel-add-btn:hover {
    background: rgba(255, 140, 0, 0.1);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    box-shadow: inset 0 0 8px rgba(255, 140, 0, 0.1);
}

/* Loader Overlay & Spinner */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 8, 6, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader-content > *:not(:last-child) {
    margin-bottom: 16px;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 140, 0, 0.15);
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.25);
}

.loader-text {
    color: var(--text-main);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: pulseText 1.5s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulseText {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ===== Scrollbars ultra-subtiles & thématiques ===== */
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 140, 0, 0.2) transparent;
}

/* WebKit (Chrome, CEP) */
::-webkit-scrollbar {
    width: 3px;
    height: 3px;
    background: transparent;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(255, 191, 0, 0.18) 0%,
        rgba(255, 140, 0, 0.28) 50%,
        rgba(255, 191, 0, 0.18) 100%
    );
    border-radius: 2px;
    opacity: 0.3;
    transition: background 0.3s ease, opacity 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        rgba(255, 191, 0, 0.45) 0%,
        rgba(255, 140, 0, 0.65) 50%,
        rgba(255, 191, 0, 0.45) 100%
    );
    opacity: 1;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* =====================================================
   BATCH PROCESSING - CHIP CHECKBOXES
   ===================================================== */

.batch-chip {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    flex: 1 1 calc(50% - 6px);
    margin: 3px;
}

.batch-chip-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.batch-chip-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.18s ease;
    user-select: none;
    letter-spacing: 0.03em;
    width: 100%;
}

.batch-chip-label > *:not(:last-child) {
    margin-right: 5px;
}

.batch-chip:hover .batch-chip-label {
    color: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 126, 95, 0.4);
    background: rgba(255, 126, 95, 0.08);
}

.batch-chip-input:checked + .batch-chip-label {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 126, 95, 0.28), rgba(254, 180, 123, 0.22));
    border-color: rgba(255, 126, 95, 0.7);
    box-shadow: 0 0 8px rgba(255, 126, 95, 0.2);
}

.batch-chip-input:checked + .batch-chip-label svg {
    stroke: #ff7e5f;
}

/* Custom Header Buttons Styles with SVGs */
.settings-btn, .whatsapp-btn {
    position: absolute !important;
    top: 8px !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 6px !important;
    color: rgba(255, 255, 255, 0.75) !important;
    cursor: pointer !important;
    opacity: 0.8 !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
}
.settings-btn {
    left: 8px !important;
}
.whatsapp-btn {
    right: 8px !important;
    border-color: rgba(37, 211, 102, 0.35) !important;
}
.settings-btn:hover {
    opacity: 1 !important;
    color: #ffaa00 !important;
    border-color: rgba(255, 165, 0, 0.5) !important;
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.3) !important;
}
.whatsapp-btn:hover {
    opacity: 1 !important;
    color: #25d366 !important;
    border-color: rgba(37, 211, 102, 0.7) !important;
    box-shadow: 0 0 8px rgba(37, 211, 102, 0.4) !important;
}
.settings-btn svg, .whatsapp-btn svg {
    display: block;
    pointer-events: none;
}

/* Compact Logo Styles */
.logo {
    font-size: 16px !important;
    letter-spacing: 3.5px !important;
    margin-bottom: 2px !important;
}
.logo .highlight {
    letter-spacing: 1px !important;
    margin-left: 2px !important;
}
.subtitle {
    font-size: 7.5px !important;
    letter-spacing: 2.2px !important;
    margin-top: -3px !important;
}

/* Premium Signature settings UI - Logo Type Selector Cards */
.logo-type-selector {
    display: flex;
    margin-top: 5px;
    margin-bottom: 12px;
}

.logo-type-selector > *:not(:last-child) {
    margin-right: 8px;
}
.logo-type-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}
.logo-type-card svg {
    margin-bottom: 5px;
    stroke: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
}
.logo-type-card span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.logo-type-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 140, 0, 0.3);
    color: #fff;
}
.logo-type-card:hover svg {
    stroke: #fff;
}
.logo-type-card.active {
    background: rgba(255, 140, 0, 0.06);
    border-color: rgba(255, 140, 0, 0.8);
    color: #ffaa00;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.15);
}
.logo-type-card.active svg {
    stroke: #ffaa00;
}

.signature-position-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 12px;
    gap: 12px;
    width: 104px;
    margin: 10px auto 16px auto;
}
.pos-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    width: 46px;
    height: 46px;
}
.pos-btn svg {
    stroke: rgba(255, 255, 255, 0.45);
    transition: stroke 0.2s ease;
}
.pos-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 140, 0, 0.3);
    color: #fff;
}
.pos-btn:hover svg {
    stroke: #fff;
}
.pos-btn.active {
    background: rgba(255, 140, 0, 0.06);
    border-color: rgba(255, 140, 0, 0.85);
    color: #ffaa00;
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.15);
}
.pos-btn.active svg {
    stroke: #ffaa00;
}

/* Carousel Image Deletion Styles */
.carousel-track .preset-wrapper {
    position: relative !important;
    width: 60px !important;
    height: 75px !important;
    margin: 0 !important;
}
.carousel-track .preset-wrapper .preset-btn {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
}
.preset-delete-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.65);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    line-height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 12;
    box-shadow: 0 1px 4px rgba(0,0,0,0.45);
    transition: transform 0.15s ease, background-color 0.15s ease;
    padding: 0;
}
.preset-delete-btn:hover {
    transform: scale(1.15);
    background-color: rgb(220, 38, 38);
}
.preset-delete-btn:active {
    transform: scale(0.9);
}

/* Responsive UI overrides for small/short viewport dimensions (Photoshop CEP Docked Panels) */
@media (max-height: 480px), (max-width: 250px) {
    .settings-overlay {
        padding: 5px;
    }
    .settings-content {
        max-height: calc(100vh - 10px);
    }
    .settings-header {
        padding: 8px 12px;
    }
    .settings-header h3 {
        font-size: 9px;
        letter-spacing: 1px;
    }
    .close-btn {
        font-size: 16px;
    }
    .settings-body {
        padding: 10px;
    }
    .settings-body > *:not(:last-child) {
        margin-bottom: 8px;
    }
    .input-group > *:not(:last-child) {
        margin-bottom: 4px;
    }
    .logo-type-selector {
        margin-top: 2px;
        margin-bottom: 4px;
    }
    .logo-type-selector > *:not(:last-child) {
        margin-right: 6px;
    }
    .logo-type-card {
        padding: 6px 4px;
        border-radius: 6px;
    }
    .logo-type-card svg {
        margin-bottom: 2px;
        width: 14px;
        height: 14px;
    }
    .logo-type-card span {
        font-size: 9px;
    }
    input[type="text"] {
        padding: 6px;
        font-size: 11px;
    }
    .sub-btn {
        padding: 4px;
        font-size: 9px;
    }
    .signature-position-grid {
        margin: 4px auto 6px auto;
        gap: 8px;
        width: 80px;
    }
    .pos-btn {
        width: 34px;
        height: 34px;
        border-radius: 6px;
    }
    .pos-btn svg {
        width: 15px;
        height: 15px;
    }
    .save-btn {
        padding: 8px;
        font-size: 11px;
        margin-top: 2px;
    }
}


