/* STYLES COMMUNS - Mobile & Desktop */

/* ========================================
   DESIGN SYSTEM - pixel-editor
   Refonte UI v2.0
   ======================================== */

:root {
    /* Couleur principale */
    --color-primary: #FF7300;
    --color-primary-hover: #E66800;
    --color-primary-light: #FFF3E8;
    --color-primary-rgb: 255, 115, 0;

    /* Couleur secondaire — teal pour les accents, états actifs, liens */
    --color-secondary: #00B4A6;
    --color-secondary-hover: #009E91;
    --color-secondary-light: #E6F9F8;
    --color-secondary-rgb: 0, 180, 166;

    /* Arrière-plans */
    --bg-main: #FFFFFF;
    --bg-secondary: #F5F5F7;
    --bg-sidebar: #FAFAFA;
    --bg-hover: #F0F0F2;

    /* Textes */
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --text-light: #86868B;

    /* Bordures & Ombres */
    --border-color: #E5E5EA;
    --border-light: #F0F0F2;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

    /* Rayons */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Couleurs sémantiques */
    --color-error: #e74c3c;
    --color-error-light: #fdf0ef;
    --color-error-rgb: 231, 76, 60;
    --color-success: #27ae60;
    --color-success-light: #edfaf3;
    --color-success-rgb: 39, 174, 96;
    --color-warning: #f39c12;
    --color-warning-light: #fffbef;
    --color-warning-rgb: 243, 156, 18;
    --color-info: #3498db;
    --color-info-light: #edf6fd;
    --color-info-rgb: 52, 152, 219;

    /* Espacements */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Typographie */
    --font-size-xs:   0.75rem;   /* 12px — labels, badges */
    --font-size-sm:   0.875rem;  /* 14px — secondaire, dates */
    --font-size-base: 1rem;      /* 16px — corps de texte */
    --font-size-lg:   1.125rem;  /* 18px — titres panels */
    --font-size-xl:   1.3rem;    /* ~21px — titres modals */
    --font-size-2xl:  1.5rem;    /* 24px — titres section */

    --font-weight-normal:   400;
    --font-weight-medium:   500;
    --font-weight-semibold: 600;
    --font-weight-bold:     700;

    --line-height-tight:   1.2;
    --line-height-normal:  1.5;
    --line-height-relaxed: 1.75;
}

/* Branding - Logo + Titre */
.branding {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.app-icon {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.app-text {
    height: 50px;
    width: auto;
    object-fit: contain;
}

/* Fond principal clair */
html,
body {
    background: #FFFFFF;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Animations communes */
@keyframes containerGlow {
    0% {
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.1),
            0 2px 8px rgba(0, 0, 0, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }

    100% {
        box-shadow:
            0 12px 40px rgba(0, 0, 0, 0.15),
            0 4px 12px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

@keyframes buttonPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Styles pour les dialogs/modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1500;
    padding: 24px;
    background: rgba(7, 11, 28, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal .modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    padding: 24px;
    width: min(520px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: slideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Fenêtre modale pour projets - Style simple unifié */
.mobile-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 20px;
    box-sizing: border-box;
}

.mobile-dialog-content {
    background: #FFFFFF;
    border: 1px solid var(--border-color, #E5E5EA);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.12));
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideIn 0.2s ease;
}

.mobile-dialog-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color, #E5E5EA);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary, #F5F5F7);
}

.mobile-dialog-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary, #1D1D1F);
}

.mobile-dialog-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-hover, #F0F0F2);
    color: var(--text-secondary, #6E6E73);
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-dialog-close:hover {
    background: #FF453A;
    color: white;
}

.mobile-dialog-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
    background: #FFFFFF;
}

/* Mobile adaptations */
@media (max-width: 768px) {
    .mobile-dialog {
        padding: 10px;
    }

    .mobile-dialog-content {
        max-height: 90vh;
        border-radius: 16px;
    }

    .mobile-dialog-header {
        padding: 16px 20px 12px;
    }

    .mobile-dialog-header h3 {
        font-size: 1.2rem;
    }

    .mobile-dialog-body {
        padding: 16px 20px 20px;
        max-height: calc(90vh - 80px);
    }
}

/* Classes utilitaires */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.pulse {
    animation: buttonPulse 1s infinite;
}

/* Styles pour les listes de projets dans modale */
.projects-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 16px 0;
    padding-right: 8px;
    /* Space for scrollbar */
}

/* Custom scrollbar pour la liste de projets */
.projects-list::-webkit-scrollbar {
    width: 6px;
}

.projects-list::-webkit-scrollbar-track {
    background: var(--bg-secondary, #F5F5F7);
    border-radius: 3px;
}

.projects-list::-webkit-scrollbar-thumb {
    background: var(--border-color, #E5E5EA);
    border-radius: 3px;
}

.projects-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-light, #86868B);
}

.project-item {
    padding: 12px 16px;
    margin: 8px 0;
    background: var(--bg-secondary, #F5F5F7);
    border: 1px solid var(--border-color, #E5E5EA);
    border-radius: var(--radius-md, 12px);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.project-preview-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-preview-img {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-sm, 8px);
    background: #FFFFFF;
    border: 1px solid var(--border-color, #E5E5EA);
}

.project-preview-placeholder {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: #FFFFFF;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border-color, #E5E5EA);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.project-info-inner {
    flex: 1;
    min-width: 0;
}

.project-item:hover {
    background: var(--bg-hover, #F0F0F2);
    border-color: var(--color-primary, #FF7300);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
}

.project-item:active {
    transform: scale(0.98);
}

.project-item.selected {
    background: var(--color-primary-light, #FFF3E8) !important;
    border-color: var(--color-primary, #FF7300) !important;
    box-shadow: 0 0 0 2px rgba(255, 115, 0, 0.2) !important;
}

.project-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #1D1D1F);
    margin-bottom: 4px;
}

.project-date {
    font-size: 0.9rem;
    color: var(--text-secondary, #6E6E73);
    font-style: italic;
}

/* Boutons dialog - Style simple */
.dialog-button {
    padding: 10px 20px;
    border: 1px solid var(--border-color, #E5E5EA);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-secondary, #F5F5F7);
    color: var(--text-primary, #1D1D1F);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    flex: 1;
}

.dialog-button:hover:not(:disabled) {
    background: var(--bg-hover, #F0F0F2);
    border-color: var(--color-primary, #FF7300);
}

.dialog-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.dialog-button.secondary {
    background: #FFFFFF;
    border-color: var(--border-color, #E5E5EA);
}

.dialog-button.danger {
    background: #FF453A;
    border-color: #FF453A;
    color: #FFFFFF;
}

.dialog-button.danger:hover:not(:disabled) {
    background: #E03E35;
    border-color: #E03E35;
}

.confirm-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 11, 28, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
    padding: 16px;
}

.confirm-dialog {
    width: min(360px, 100%);
    background: linear-gradient(155deg, rgba(36, 48, 94, 0.95), rgba(28, 38, 80, 0.9));
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    outline: none;
}

.confirm-dialog h3 {
    margin: 0 0 12px;
    font-size: 1.15rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.98);
}

.confirm-dialog p {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
}

.confirm-dialog-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

/* Sélection de couleur désactivée */
::selection {
    background: transparent;
}

::-moz-selection {
    background: transparent;
}

/* Fenêtre de dialogue de sauvegarde - Centrée au milieu de l'écran */
.save-dialog {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9998 !important;
    padding: 20px !important;
    animation: fadeIn 0.3s ease !important;
}

.save-dialog-content {
    background: linear-gradient(155deg, rgba(36, 48, 94, 0.98), rgba(28, 38, 80, 0.95)) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 24px !important;
    padding: 32px !important;
    width: 100% !important;
    max-width: 420px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
    animation: fadeIn 0.3s ease !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

.save-dialog h3 {
    margin: 0 0 20px 0 !important;
    text-align: center !important;
    font-size: 1.3rem !important;
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 600 !important;
}

.save-dialog input {
    width: 100% !important;
    padding: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 16px !important;
    font-size: 1rem !important;
    margin-bottom: 20px !important;
    outline: none !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    color: white !important;
    box-sizing: border-box !important;
}

.save-dialog input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

.save-dialog input:focus {
    border-color: rgba(0, 122, 255, 0.6) !important;
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2) !important;
}

.save-dialog .dialog-buttons {
    display: flex !important;
    gap: 12px !important;
    margin-top: 20px !important;
}

.save-dialog .dialog-buttons button {
    flex: 1 !important;
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.save-dialog .dialog-buttons button#dialogSave {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.9), rgba(0, 86, 179, 0.9)) !important;
    color: white !important;
}

.save-dialog .dialog-buttons button#dialogSave:hover {
    background: linear-gradient(135deg, rgba(0, 122, 255, 1), rgba(0, 86, 179, 1)) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4) !important;
}

.save-dialog .dialog-buttons button#dialogCancel {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.save-dialog .dialog-buttons button#dialogCancel:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px) !important;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Focus et accessibilité */
button:focus,
input:focus {
    outline: 2px solid rgba(0, 122, 255, 0.6);
    outline-offset: 2px;
}

/* Transitions globales */
* {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* États de boutons génériques */
button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    user-select: none;
    -webkit-user-select: none;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

button:active {
    transform: scale(0.98);
}

/* Input de couleur commun */
input[type="color"] {
    border: none;
    cursor: pointer;
    background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
    border-radius: inherit;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Responsive utilities */
@media (max-width: 480px) {
    .desktop-only {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .mobile-only {
        display: none !important;
    }
}

/* User Profile Styles */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    margin-right: 10px;
}

.user-profile-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    max-width: 200px;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.user-profile-display:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.02);
}

.user-profile-display:active {
    transform: scale(0.98);
}

.user-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover, #F0F0F2);
}

/* S'assurer que le contenu de l'avatar remplit le cercle */
.user-avatar svg,
.user-avatar img,
.user-avatar > div {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.user-email {
    font-size: 12px;
    color: #666;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

@media (max-width: 768px) {
    .user-profile {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 100;
    }

    .user-email {
        display: none;
    }

    .logout-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

.credits-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 25, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    padding: 24px;
}

.credits-content {
    width: min(640px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    background: linear-gradient(160deg, rgba(32, 36, 72, 0.92), rgba(18, 20, 48, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.92);
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.credits-content h2 {
    margin-top: 0;
    font-size: clamp(1.6rem, 2.8vw, 2rem);
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.02em;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.credits-section {
    margin-top: 24px;
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.credits-section h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

.credits-section p {
    margin: 8px 0;
    line-height: 1.6;
}

.credits-section ul {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.credits-section ul li {
    line-height: 1.5;
}

.credits-contact {
    font-weight: 600;
    color: #7bd5ff;
}

.creator-story ul li::marker {
    color: #7bd5ff;
}

.acknowledgements p,
.legal p {
    font-size: 0.95rem;
}

.close-credits {
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #4a90e2, #7b68ee);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(74, 144, 226, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.close-credits:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(74, 144, 226, 0.45);
}

.close-credits:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.35);
}

@media (max-width: 560px) {
    .credits-content {
        padding: 24px;
        border-radius: 20px;
    }

    .credits-section {
        padding: 16px;
    }
}

.profile-modal .modal-content {
    width: min(520px, 92vw);
    max-height: 88vh;
    overflow: hidden;
    padding: 0;
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(28, 33, 68, 0.94), rgba(16, 18, 40, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.92);
}

.profile-modal .modal-header {
    padding: 22px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-modal .modal-body {
    padding: 24px 28px 28px;
    max-height: 70vh;
    overflow-y: auto;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.profile-form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-form-row label {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.profile-form-row select,
.profile-form-row input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border 0.2s ease;
}

.profile-form-row select:focus,
.profile-form-row input[type="text"]:focus {
    border-color: rgba(123, 213, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(123, 213, 255, 0.18);
}

.profile-form-row select option {
    color: #0f1428;
}

.profile-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.profile-form-actions .dialog-button {
    min-width: 140px;
}

@media (max-width: 560px) {
    .profile-modal .modal-body {
        padding: 20px 20px 24px;
    }

    .profile-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .profile-form-actions .dialog-button {
        width: 100%;
    }
}

.profile-intro {
    margin: 0 0 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.82);
}

/* =====================================================
   SHARING SYSTEM STYLES
   ===================================================== */

/* Notification button with badge */
.notification-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4757;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Share modal content */
.share-modal-content {
    max-width: 520px;
    min-width: 320px;
}

.share-method-choice h4 {
    margin: 0 0 16px;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.9);
}

.share-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-method-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    color: white;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    width: 100%;
}

.share-method-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.share-method-btn.primary {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.2), rgba(88, 86, 214, 0.2));
    border-color: rgba(0, 122, 255, 0.5);
}

.share-method-btn.primary:hover {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.3), rgba(88, 86, 214, 0.3));
    border-color: rgba(0, 122, 255, 0.7);
}

.method-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.method-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.method-content strong {
    font-size: 1rem;
    font-weight: 600;
}

.method-content small {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
}

/* Share Supabase form */
.share-supabase-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(0, 122, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-select option {
    background: #1a1f3a;
    color: white;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.share-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Shared projects modal */
.shared-projects-modal {
    max-width: 720px;
    min-width: 320px;
}

.shared-projects-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.loading-state,
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-state-icon {
    font-size: 3rem;
    opacity: 0.5;
}

/* Shared project card */
.shared-project-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    gap: 16px;
    transition: all 0.25s ease;
}

.shared-project-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.shared-project-card.pending {
    border-left: 4px solid #007AFF;
}

.shared-project-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.shared-project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.shared-project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.shared-project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.shared-project-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: white;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shared-project-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.shared-project-status.pending {
    background: rgba(0, 122, 255, 0.2);
    color: #5AC8FA;
    border: 1px solid rgba(90, 200, 250, 0.3);
}

.shared-project-status.accepted {
    background: rgba(52, 199, 89, 0.2);
    color: #34C759;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.shared-project-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.shared-project-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shared-project-message {
    margin-top: 4px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid rgba(0, 122, 255, 0.5);
    border-radius: 6px;
    font-size: 0.9rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
}

.shared-project-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.shared-project-action-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.shared-project-action-btn.primary {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
}

.shared-project-action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.shared-project-action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.shared-project-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.shared-project-action-btn.danger {
    background: rgba(255, 59, 48, 0.15);
    color: #FF453A;
    border: 1px solid rgba(255, 69, 58, 0.3);
}

.shared-project-action-btn.danger:hover {
    background: rgba(255, 59, 48, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .share-modal-content,
    .shared-projects-modal {
        max-width: 95vw;
    }

    .shared-project-card {
        flex-direction: column;
    }

    .shared-project-thumbnail {
        width: 100%;
        height: 120px;
    }

    .share-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .shared-project-actions {
        flex-direction: column;
    }

    .shared-project-action-btn {
        width: 100%;
    }
}

/* Phase 3 : règles .pixel supprimées — rendu 100% canvas */

/* ========================================
   MODAL TAILLE DE GRILLE
   ======================================== */

.grid-size-modal-content {
    max-width: 460px;
    width: 90%;
}

.grid-size-subtitle {
    text-align: center;
    color: rgba(0, 0, 0, 0.55);
    font-size: 13px;
    margin: 0 0 16px 0;
}

.grid-size-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.grid-size-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 4px;
}

.grid-size-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.grid-size-btn.active {
    background: rgba(99, 179, 237, 0.18);
    border-color: #63b3ed;
    color: #1a6fa8;
}

.grid-size-label {
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

.grid-size-desc {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.50);
}

.grid-size-btn.active .grid-size-desc {
    color: rgba(26, 111, 168, 0.85);
}

.grid-size-warning {
    text-align: center;
    font-size: 12px;
    color: rgba(160, 100, 0, 0.85);
    margin: 0 0 6px 0;
}

.grid-size-current {
    text-align: center;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.55);
    margin: 0;
}

.grid-size-indicator {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
}

/* ── Panel rows (frames / layers / stamps) — shared desktop + mobile ──────── */
.layer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    cursor: pointer;
    border-bottom: 1px solid #F0F0F2;
    transition: background 0.1s;
}
.layer-item:last-child { border-bottom: none; }
.layer-item:hover { background: #F5F5F7; }
.layer-item.active { background: #FFF3E8; border-left: 3px solid #FF7300; }
.layer-item.layer-dragging { opacity: 0.4; background: #F0F0F2; }
.layer-item.layer-drop-above { border-top: 2px solid #FF7300; }
.layer-item.layer-drop-below { border-bottom: 2px solid #FF7300; }

.layer-eye {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    line-height: 1;
    color: #555;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.layer-eye:hover { background: #E8E8ED; color: #1D1D1F; }
.layer-eye.layer-hidden { color: #BBBBBB; }

.layer-name {
    flex: 1;
    font-size: 12px;
    color: #1D1D1F;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: text;
}
.layer-name-hidden { opacity: 0.35; font-style: italic; }

.layer-actions { display: flex; gap: 2px; flex-shrink: 0; }

.layer-action-btn {
    background: none;
    border: 1px solid #E5E5EA;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 11px;
    cursor: pointer;
    color: #666;
}
.layer-action-btn:hover { background: #F0F0F2; }
.layer-delete-btn:hover { background: #FFE5E5; color: #FF3B30; border-color: #FF3B30; }

.layer-drag-handle {
    cursor: grab;
    color: #BBBBBB;
    font-size: 14px;
    flex-shrink: 0;
    padding: 0 2px;
    user-select: none;
    line-height: 1;
}
.layer-drag-handle:hover { color: #888; }
.layer-drag-handle:active { cursor: grabbing; }

.frames-hdr-btn {
    background: none;
    border: 1px solid #D1D1D6;
    border-radius: 5px;
    padding: 0;
    width: 28px;
    height: 28px;
    font-size: 11px;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: background 0.1s;
    flex-shrink: 0;
}
.frames-hdr-btn:hover { background: #E8E8ED; }
.frames-hdr-btn svg { width: 13px; height: 13px; }
.frames-hdr-btn.primary { background: #FF7300; border-color: #FF7300; color: white; font-weight: 600; }
.frames-hdr-btn.primary:hover { background: #e56600; }

.frame-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    cursor: pointer;
    border-bottom: 1px solid #F0F0F2;
    transition: background 0.1s;
    user-select: none;
}
.frame-row:last-child { border-bottom: none; }
.frame-row:hover { background: #F5F5F7; }
.frame-row.active { background: #FFF3E8; border-left: 3px solid #FF7300; }
.frame-row.frame-dragging { opacity: 0.4; background: #F0F0F2; }
.frame-row.frame-drop-above { border-top: 2px solid #FF7300; }
.frame-row.frame-drop-below { border-bottom: 2px solid #FF7300; }

.frame-drag-handle {
    cursor: grab;
    color: #BBBBBB;
    font-size: 13px;
    flex-shrink: 0;
    padding: 0 2px;
    user-select: none;
    line-height: 1;
}
.frame-drag-handle:hover { color: #888; }
.frame-drag-handle:active { cursor: grabbing; }

.frame-row-thumb {
    width: 28px;
    height: 28px;
    border: 1px solid #D1D1D6;
    border-radius: 3px;
    background: white;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.frame-row-name {
    flex: 1;
    font-size: 12px;
    color: #1D1D1F;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.frame-row-del {
    background: none;
    border: 1px solid #E5E5EA;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 11px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.1s, background 0.1s;
}
.frame-row-del svg { width: 11px; height: 11px; }
.frame-row:hover .frame-row-del { opacity: 1; }
.frame-row-del:hover { background: #FFE5E5; color: #FF3B30; border-color: #FF3B30; }

.stamp-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    cursor: pointer;
    border-bottom: 1px solid #F0F0F2;
    transition: background 0.1s;
    user-select: none;
}
.stamp-row:last-child { border-bottom: none; }
.stamp-row:hover { background: #F5F5F7; }
.stamp-row.active { background: #FFF3E8; border-left: 3px solid #FF7300; }
.stamp-row.frame-dragging { opacity: 0.4; background: #F0F0F2; }
.stamp-row.stamp-drop-above { border-top: 2px solid #FF7300; }
.stamp-row.stamp-drop-below { border-bottom: 2px solid #FF7300; }

.stamp-drag-handle {
    cursor: grab;
    color: #BBBBBB;
    font-size: 13px;
    flex-shrink: 0;
    padding: 0 2px;
    line-height: 1;
}
.stamp-drag-handle:hover { color: #888; }

.stamp-row-thumb {
    width: 28px;
    height: 28px;
    border: 1px solid #D1D1D6;
    border-radius: 3px;
    background: white;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.stamp-row-name {
    flex: 1;
    font-size: 12px;
    color: #1D1D1F;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stamp-row-name.dimmed { opacity: 0.35; font-style: italic; }

.stamp-row-del {
    background: none;
    border: 1px solid #E5E5EA;
    border-radius: 4px;
    padding: 2px 5px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.1s;
}
.stamp-row-del svg { width: 11px; height: 11px; }
.stamp-row:hover .stamp-row-del { opacity: 1; }
.stamp-row-del:hover { background: #FFE5E5; color: #FF3B30; border-color: #FF3B30; }

.stamps-empty {
    padding: 20px 12px;
    text-align: center;
    color: #BBBBBB;
    font-size: 11px;
    line-height: 1.6;
}
/* ── Import Sprite Sheet Modal ────────────────────────────────────────────── */
.ss-import-drop-zone {
    border: 2px dashed var(--border-color, #E5E5EA);
    border-radius: var(--radius-sm, 8px);
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    margin-bottom: 14px;
}
.ss-import-drop-zone:hover,
.ss-import-drop-zone.drag-over {
    border-color: var(--color-primary, #FF7300);
    background: rgba(255,115,0,0.1);
}
.ss-import-drop-zone.has-file {
    border-style: solid;
    border-color: #34C759;
    color: #34C759;
}

.ss-import-preview-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 0 auto 14px;
    max-width: 100%;
}
.ss-import-preview-wrap canvas {
    display: block;
    max-width: 100%;
    image-rendering: pixelated;
    border-radius: 4px;
}
.ss-import-grid-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.ss-import-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.ss-import-config-grid label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ss-import-config-grid input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.95);
}
.ss-import-config-grid input[type="number"]:focus {
    outline: none;
    border-color: var(--color-primary, #FF7300);
}

.ss-import-frame-count {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary, #FF7300);
    text-align: center;
    margin-bottom: 12px;
    min-height: 1.2em;
}
.ss-import-resample-note {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    text-align: center;
    margin-bottom: 14px;
}

.ss-import-mode-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}
.ss-import-mode-btn {
    flex: 1;
    padding: 9px 6px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    color: rgba(255,255,255,0.7);
}
.ss-import-mode-btn.active {
    border-color: var(--color-primary, #FF7300);
    background: rgba(255,115,0,0.15);
    color: var(--color-primary, #FF7300);
}

@media (max-width: 480px) {
    .ss-import-config-grid {
        grid-template-columns: 1fr 1fr;
    }
}
