/* ========================================
   VARIABLES CSS - THEMES
   ======================================== */
:root[data-theme="dark"] {
    --bg-primary: #02041B;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent: #ebef81;
    --accent-hover: #d2d475;
    --border: #334155;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #01041c;
    --text-secondary: #64748b;
    --accent: #ebef81;
    --accent-hover: #d2d475;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* ========================================
   BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Playfair Display', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    flex-direction: column;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   LAYOUT - CONTAINER & CONTENT
   ======================================== */
.container {
    display: flex;
    width: 100%;
}

.content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    width: calc(100% - 280px);
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow: hidden;
    z-index: 1000;
}

.sidebar nav {
    flex: 1;
}

.upgrade_small_cta {
     font-size: 10px;
     color: var(--accent);
     text-decoration: none;
     text-align: center;
}

.maintitle {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    display: block;
    margin-bottom: 2rem;
}

.maintitle span {
    color: var(--accent);
}

.user-email {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.sidebar nav a:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.sidebar nav a .material-symbols-outlined {
    font-size: 1.25rem;
}

/* Adsense dans sidebar */
.adsbygoogle {
    margin: 1.5rem 0;
    background: var(--bg-secondary);
    border-radius: 8px;
    min-height: 100px;
}

/* Footer dans sidebar */
.sidebar-footer-links {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.sidebar-footer-links a,
.sidebar-footer-links span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.sidebar-footer-links a:hover {
    color: var(--accent);
}

.don_info {
    font-size: 0.7rem;
    font-style: italic;
    color: var(--text-secondary);
}

/* Mobile burger menu */
.burger-menu {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
}

/* Masquer par défaut */
.dark {
    display: none !important;
}
.light {
    display: none !important;
}

/* Afficher selon le thème actif */
:root[data-theme="dark"] .dark {
    display: block !important;
}

:root[data-theme="light"] .light {
    display: block !important;
}

/* Si ce sont des images inline */
:root[data-theme="dark"] img.dark,
:root[data-theme="dark"] span.dark {
    display: inline !important;
}

:root[data-theme="light"] img.light,
:root[data-theme="light"] span.light {
    display: inline !important;
}

/* ========================================
   BLOC TITRE DE PAGE (réutilisable)
   ======================================== */

.page-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 4px 20px var(--shadow);
}

/* Effet de brillance animé */
.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(235, 239, 129, 0.1), transparent);
    transition: left 0.6s;
}

.page-header:hover::before {
    left: 100%;
}

/* Accent géométrique */
.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
}

.page-header-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.page-header h1 .emoji {
    font-size: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(235, 239, 129, 0.3);
    color: var(--bg-primary);
}

.page-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0;
    position: relative;
}

/* Bouton retour stylisé */
.page-header-back {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.page-header-back:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(235, 239, 129, 0.4);
    cursor: pointer;
}

.page-header-back .material-symbols-outlined {
    font-size: 1.5rem;
    transition: transform 0.3s;
}

.page-header-back:hover .material-symbols-outlined {
    transform: translateX(-4px);
}

/* Variante compacte */
.page-header.compact {
    padding: 1.5rem 2rem;
}

.page-header.compact h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.page-header.compact h1 .emoji {
    width: 50px;
    height: 50px;
    font-size: 2rem;
}

.page-header.compact p {
    font-size: 1rem;
}

.page-header.compact .page-header-back {
    padding: 0.75rem 1.25rem;
}

/* Variante avec motif */
.page-header.pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(235, 239, 129, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(235, 239, 129, 0.05) 0%, transparent 50%);
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        padding: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .page-header h1 .emoji {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .page-header-back {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   PAGE ELEMENTS
   ======================================== */
   
   
.page-title {
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-title p {
    color: var(--text-secondary);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s;
    margin-bottom: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

/* ========================================
   FORM STYLES
   ======================================== */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    flex: 1;
    text-decoration: none;
}

.icon-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.icon-btn.danger:hover {
    background: var(--danger);
    color: white;
}

/* ========================================
   URLS SECTION
   ======================================== */
.urls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.urls-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.urls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ========================================
   URL CARDS
   ======================================== */
.url-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    box-shadow: 0 1px 3px var(--shadow);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.url-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-title {
    flex: 1;
}

.card-title h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.card-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.short-url-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.short-url-block code {
    font-family: 'Jersey', monospace;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.short-url-block a {
    text-decoration: none;
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
}

.copy-btn:hover {
    color: var(--accent);
}

.destination-url {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   STATS & BADGES
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.variations-badge {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.variations-badge-none {
    display: inline-block;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-footer {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ========================================
   MODALE QR CODE
   ======================================== */
.qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.qr-modal.active {
    display: flex;
}

.qr-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px var(--shadow);
    position: relative;
}

.qr-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.qr-modal-close:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.qr-modal h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.qr-modal h2 .material-symbols-outlined {
    font-size: 2rem;
    color: var(--accent);
}

.qr-modal h3 {
    margin: 20px 0 10px;
    font-size: 1.1em;
    color: var(--text-secondary);
}

#qr-img {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 1rem auto;
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: white;
}

.qr-download-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.btn-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-qr:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-qr span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-qr .material-symbols-outlined {
    font-size: 1.5rem;
}

.btn-qr-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-qr-secondary:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.format-label {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.4s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-icon {
    font-size: 1.25rem;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-left: 280px;
}

.maintitle-footer {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.maintitle-footer span {
    color: var(--accent);
}

footer h4 {
    font-size: 2rem;
    margin: 0.5rem 0;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }
    
    .burger-menu {
        display: block;
    }
    
    .urls-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .url-card {
        max-width: 100%;
        overflow: hidden;
    }
    
    .short-url-block {
        overflow: hidden;
    }
    
    .short-url-block code {
        max-width: calc(100% - 40px);
    }
    
    .stats-grid {
        gdisplay: grid;
    }
    
    .qr-download-buttons {
        grid-template-columns: 1fr;
    }
    
    footer {
        margin-left: 0;
    }
    
    .desktop {
        display: none;
    }
}

/* ========================================
   FLOATING ACTION BUTTON (FAB)
   ======================================== */
.fab-create {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: var(--bg-primary);
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s ease;
    z-index: 999;
    border: none;
}

.fab-create:hover {
    width: auto;
    border-radius: 8px;
    padding: 0 1.5rem;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.fab-create .fab-text {
    display: none;
    margin-left: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
}

.fab-create:hover .fab-text {
    display: inline;
}

.fab-create.show {
    display: flex;
}

/* Masquer sur mobile */
@media (max-width: 768px) {
    .fab-create {
        display: none !important;
    }
}

/* ========================================
   PAGE EDIT - STYLES SPÉCIFIQUES
   ======================================== */

/* En-tête de page edit */
.edit-page-title {
    margin-bottom: 2rem;
}

.edit-page-title h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Messages de succès et erreur */
.success-message, .error-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.success-message {
    background: var(--success);
    color: white;
}

.error-message {
    background: var(--danger);
    color: white;
}

/* Bouton de suppression */
.delete-btn {
    background: var(--danger);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-left: 1rem;
    transition: all 0.3s;
}

.delete-btn:hover {
    background: #dc2626;
}

/* Section UTM variations */
.utm-variations {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.utm-variations h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Grid pour formulaire UTM */
.utm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.utm-grid .form-group {
    margin-bottom: 0;
}

.utm-grid .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.utm-grid .form-group input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s;
}

.utm-grid .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
}

/* Sélecteur de tags */
.tag-selector {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.tag-badge {
    display: inline-block;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin: 0.25rem;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.tag-badge:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.tag-badge.selected {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
}

/* Section variations */
.variations-section {
    margin-bottom: 2rem;
}

/* Bouton retour */
.btn-back {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-back:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Card de formulaire edit */
.edit-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.edit-form-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.edit-form-card label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.edit-form-card input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.edit-form-card input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ========================================
   PAGES AUTHENTIFICATION (login, signup, reset)
   ======================================== */

/* Container centré pour les pages d'authentification */
.auth-container {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.auth-container h1 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Card de formulaire d'authentification */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px var(--shadow);
    position: relative;
    overflow: hidden;
}

/* Effet accent en haut */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-card label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.auth-card input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(235, 239, 129, 0.2);
}

.auth-card button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.5rem;
}

.auth-card button[type="submit"]:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(235, 239, 129, 0.4);
}

/* Messages d'erreur/succès dans l'auth */
.auth-message {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.auth-message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

/* Liens en bas du formulaire */
.auth-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.auth-links a {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.auth-links a:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

/* Séparateur "ou" */
.auth-separator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        margin: 2rem auto;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .auth-links {
        flex-direction: column;
    }
    
    .auth-links a {
        width: 100%;
        text-align: center;
    }
    
    .urls-header-btn {
        display: flex;
        flex-direction: column;
    }
    
    .urls-header-btn a {
        font-size: 12px;
    }
    
    .urls-header-btn .btn {
        padding: 0.25rem;
    }
}


.premium-function-cta {
    background-color: var(--accent);
    border: 1px solid var(--border);
    color: var(--bg-card);
    padding: 10px;
    text-decoration: none;
}

.premium-function-cta:hover {
    background-color: var(--bg-secondary);
    border: 1px solid var(--accent);
    color: var(--bg-accent);
    transition-duration: 0.5s;
}


/* Expiration section */

.expiration-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.expiration-header h3 {
    margin: 0;
    font-size: 18px;
}

.expiration-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.expiration-status.permanent {
    background: #dcfce7;
    color: #16a34a;
}

.expiration-status.expiring {
    background: #fef3c7;
    color: #f59e0b;
}

.expiration-status.expired {
    background: #fee2e2;
    color: #dc2626;
}

.date-picker-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.date-input-group {
    flex: 1;
    min-width: 250px;
}

.date-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

#expiration_date {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

#expiration_date:focus {
    border-color: #2563eb;
    outline: none;
}

.btn-group {
    display: flex;
    gap: 8px;
}

.btn-expiration {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}


.btn-expiration.secondary {
    background: #f3f4f6;
    color: #666;
}

.btn-expiration.secondary:hover {
    background: #e5e7eb;
}

.expiration-info {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: start;
    gap: 8px;
}

.expiration-info .material-symbols-outlined {
    font-size: 20px;
    color: #2563eb;
}

/* Cursor pointer + effet hover */
#expires_at:not(:disabled) {
    cursor: pointer !important;
}

#expires_at:not(:disabled):hover {
    border-color: #2563eb;
}

/* Empêcher la sélection du texte */
#expires_at {
    user-select: none;
    -webkit-user-select: none;
}

/* Filters Container */
.filters-container {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Tags Filter */
.tags-filter {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
}

.filter-label .material-symbols-outlined {
    font-size: 20px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--tag-color, #ebee81)15;
    border: 2px solid var(--tag-color, #ebee81);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-filter-btn:hover {
    background: var(--tag-color, #ebee81)30;
    transform: translateY(-2px);
}

.tag-filter-btn.active {
    background: var(--tag-color, #ebee81);
    border-color: var(--tag-color, #ebee81);
    color: #01041c;
    font-weight: 600;
}

.tag-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85em;
}

.tag-filter-btn.active .tag-count {
    background: rgba(1, 4, 28, 0.2);
}

/* Expired Filter Toggle */
.expired-filter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #ebee81;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 0.95em;
    color: var(--text-primary);
    font-weight: 500;
}

/* URL Tags in Cards */
.url-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.url-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

/* Hidden state for filtered cards */
.url-card.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .filters-container {
        padding: 16px;
    }
    
    .tags-list {
        gap: 6px;
    }
    
    .tag-filter-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

.oauth_card {
    padding: 20px;
    margin: auto;
    width: fit-content;
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.success-icon span {
    font-size: 34pt;
    color: var(--bg-card);
}

/* Bannière d'erreur de validation */
.validation-error-banner {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    border: 2px solid #dc3545;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    animation: slideDown 0.3s ease-out;
}

.validation-error-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.validation-error-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #dc3545;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.validation-error-text {
    flex: 1;
}

.validation-error-text h3 {
    margin: 0 0 8px 0;
    color: #721c24;
    font-size: 1.1rem;
}

.validation-error-text p {
    margin: 4px 0;
    color: #721c24;
}

.validation-error-detail {
    font-size: 0.9rem;
    color: #856404;
    margin-top: 8px !important;
    padding: 8px 12px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 6px;
}

.validation-error-detail a {
    color: #dc3545;
    text-decoration: underline;
    font-weight: 600;
}

.validation-error-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #721c24;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.validation-error-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.icon-btn.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.icon-btn.warning:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
}