/* ===== SHARED ANIMATIONS ===== */

@keyframes commentFloatIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes dialogScaleIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== BUTTON BASE CLASSES ===== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    letter-spacing: 0.02em;
}

.btn--primary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #d4af37 100%);
    color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(201, 169, 97, 0.3);
}

.btn--primary:hover {
    background: linear-gradient(135deg, #d4af37 0%, #e5c156 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(201, 169, 97, 0.5);
}

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

.btn--secondary {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-text-muted);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn--secondary:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn--danger {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(229, 62, 62, 0.3);
}

.btn--danger:hover {
    background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(229, 62, 62, 0.5);
}

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

/* ===== TAB COMPONENTS ===== */

.tab {
    flex: 1;
    padding: var(--space-md);
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.tab:hover {
    color: var(--color-primary);
    background: var(--color-hover);
}

.tab--active {
    color: var(--color-primary);
    font-weight: 600;
}

.tab--active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
}

/* ===== TAG COMPONENT (Unified) ===== */

/* Base tag with dot + name pattern */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    font-size: 0.8rem;
    color: var(--color-text);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.tag--clickable {
    cursor: pointer;
}

.tag--clickable:hover {
    transform: translateY(-1px);
}

.tag--small {
    padding: 2px 8px 2px 6px;
    font-size: 0.7rem;
    gap: 4px;
}

.tag--large {
    padding: 6px 14px 6px 10px;
    font-size: 0.9rem;
    gap: 8px;
}

/* Tag dot (colored circle) */
.tag__dot,
.tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.tag--small .tag__dot {
    width: 6px;
    height: 6px;
}

.tag--large .tag__dot {
    width: 10px;
    height: 10px;
}

/* Tag name */
.tag__name {
    line-height: 1.2;
}

/* Full color badge variant */
.tag-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.tag-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tag list container */
.tag-list {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* Overflow indicator */
.tag-overflow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 9999px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* ===== TAGS TOOLTIP ===== */

.tags-tooltip {
    position: fixed;
    display: none;
    z-index: 9999;
    padding: 12px 16px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 400px;
    animation: tooltipFadeIn 0.2s ease forwards;
}

.tags-tooltip .tag {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
}

@keyframes tooltipFadeIn {
    0% {
        opacity: 0;
        transform: translateY(4px);
    }
    100% {
        opacity:1;
        transform: translateY(0);
    }
}

/* ===== TITLE TOOLTIP ===== */

.title-tooltip {
    position: fixed;
    display: none;
    z-index: 9999;
    padding: 8px 12px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-primary);
    max-width: 300px;
    word-wrap: break-word;
    animation: tooltipFadeIn 0.2s ease forwards;
}

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ROLE BADGE COMPONENT ===== */

.role-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 12px;
    margin-left: var(--space-xs);
    color: white;
    letter-spacing: 0.03em;
    line-height: 1;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.role-badge--admin {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.role-badge--moderator {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.3);
}

.role-badge--premium {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

.role-badge--membre {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 2px 6px rgba(107, 114, 128, 0.3);
}

/* ===== DELETE DIALOG COMPONENT ===== */

.delete-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease forwards;
}

.delete-dialog {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(201, 169, 97, 0.2);
    border: 1px solid rgba(201, 169, 97, 0.3);
    max-width: 400px;
    width: 90%;
    margin: var(--space-lg);
    transform: scale(0.9);
    animation: dialogScaleIn 0.3s ease forwards;
}

.delete-dialog__content {
    padding: var(--space-2xl);
    text-align: center;
}

.delete-dialog__icon {
    color: #e53e3e;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-dialog__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

.delete-dialog__message {
    font-size: 1rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-xl);
}

.delete-dialog__actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.delete-dialog__btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 100px;
}

.delete-dialog__btn--cancel {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-text-muted);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.delete-dialog__btn--cancel:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.delete-dialog__btn--confirm {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(229, 62, 62, 0.3);
}

.delete-dialog__btn--confirm:hover {
    background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(229, 62, 62, 0.5);
}

.delete-dialog__btn--confirm:active {
    transform: translateY(0);
}

/* ===== CAROUSEL COMPONENTS ===== */

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.carousel-nav svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.carousel-nav:hover {
    background: var(--color-primary);
    box-shadow: 0 4px 20px rgba(26, 54, 93, 0.2);
}

.carousel-nav:hover svg {
    stroke: white;
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-nav--prev {
    left: calc(var(--space-2xl) / 2);
}

.carousel-nav--next {
    right: calc(var(--space-2xl) / 2);
}

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-track {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    height: 100%;
    align-items: center;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    flex-shrink: 0;
    width: 200px;
    height: 55px;
    padding: var(--space-sm) var(--space-lg);
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    opacity: 0.6;
    transform: scale(0.95);
}

.carousel-item:hover {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(201, 169, 97, 0.3);
    background: rgba(201, 169, 97, 0.05);
}

.carousel-item--active {
    opacity: 1;
    transform: scale(1.02);
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.12) 0%, rgba(201, 169, 97, 0.08) 100%);
    border-color: var(--color-secondary);
    box-shadow: 0 4px 16px rgba(201, 169, 97, 0.25);
}

.carousel-item__text {
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 40px;
}

/* ===== BASE NOTE ITEMS ===== */
/* Note: .comment-item styles are now in watch.css */

.note-item {
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    animation: commentFloatIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
    will-change: transform, box-shadow;
}

.note-item::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.08) 0%, rgba(201, 169, 97, 0.03) 50%, rgba(26, 54, 93, 0.03) 100%);
    border-radius: var(--radius-xl);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: scale(1.02);
}

.note-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.05);
}

.note-item:hover::before {
    opacity: 0.6;
}

/* ===== TIMESTAMP LINKS - CRITICAL FOR CLICKABILITY ===== */

.timestamp-link {
    color: var(--color-primary, #1a365d);
    background: rgba(201, 169, 97, 0.12);
    padding: 2px 8px;
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(201, 169, 97, 0.25);
    text-decoration: none;
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.85rem;
    user-select: all;
}

.timestamp-link:hover {
    background: var(--color-secondary, #c9a761);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(201, 169, 97, 0.3);
}

.timestamp-link:active {
    transform: scale(0.98);
}

.timestamp-link:focus {
    outline: 2px solid var(--color-primary, #1a365d);
    outline-offset: 2px;
}
