/* ═══════════════════════════════════════════════════════════════════
   CortyKids — Composants
   Fichier: public/assets/css/components.css
   
   Boutons, cartes, badges, inputs, alertes, avatars, toasts.
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   1. BOUTONS
   ═══════════════════════════════════════════════════════════════════ */

.ck-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    min-height: 48px;
    border-radius: var(--ck-radius);
    font-family: var(--ck-font-title);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    transition: all var(--ck-dur) var(--ck-ease);
    background: var(--ck-navy);
    color: var(--ck-white);
    box-shadow: var(--ck-shadow-sm);
    user-select: none;
    white-space: nowrap;
}

.ck-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--ck-shadow);
    color: var(--ck-white);
}

.ck-btn:active {
    transform: translateY(0);
}

.ck-btn:disabled,
.ck-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

/* Variantes */
.ck-btn-gold {
    background: var(--ck-grad-gold);
    color: var(--ck-navy);
    box-shadow: var(--ck-shadow-gold);
}

.ck-btn-gold:hover {
    box-shadow: var(--ck-shadow-glow);
    color: var(--ck-navy);
}

.ck-btn-mint {
    background: var(--ck-grad-mint);
    color: var(--ck-navy);
}

.ck-btn-mint:hover {
    color: var(--ck-navy);
}

.ck-btn-sunset {
    background: var(--ck-grad-sunset);
    color: var(--ck-white);
}

.ck-btn-violet {
    background: var(--ck-grad-violet);
    color: var(--ck-white);
}

.ck-btn-outline {
    background: transparent;
    color: var(--ck-navy);
    border: 2px solid var(--ck-navy);
    box-shadow: none;
}

.ck-btn-outline:hover {
    background: var(--ck-navy);
    color: var(--ck-white);
}

.ck-btn-ghost {
    background: transparent;
    color: var(--ck-gold);
    box-shadow: none;
}

.ck-btn-ghost:hover {
    background: rgba(210, 154, 43, 0.1);
    color: var(--ck-gold);
}

.ck-btn-danger {
    background: var(--ck-danger);
    color: var(--ck-white);
}

/* Tailles */
.ck-btn-sm {
    padding: 8px 16px;
    min-height: 38px;
    font-size: 0.85rem;
}

.ck-btn-lg {
    padding: 16px 32px;
    min-height: 56px;
    font-size: 1.05rem;
}

.ck-btn-full {
    width: 100%;
}

/* Ripple effect (JS ajoute <span class="ck-ripple">) */
.ck-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════
   2. CARTES
   ═══════════════════════════════════════════════════════════════════ */

.ck-card {
    background: var(--ck-white);
    border-radius: var(--ck-radius-lg);
    padding: 20px;
    box-shadow: var(--ck-shadow-sm);
    border: 1px solid var(--ck-gray-100);
    transition: all var(--ck-dur) var(--ck-ease);
}

.ck-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--ck-shadow-lg);
}

.ck-card-gold {
    border-top: 4px solid var(--ck-gold);
}

.ck-card-navy {
    background: var(--ck-grad-hero);
    color: var(--ck-white);
    border: none;
}

.ck-card-navy h1,
.ck-card-navy h2,
.ck-card-navy h3,
.ck-card-navy h4 {
    color: var(--ck-white);
}

.ck-card-navy p {
    color: var(--ck-gray-300);
}

.ck-card-title {
    font-family: var(--ck-font-title);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ck-navy);
    margin-bottom: 8px;
}

.ck-card-subtitle {
    font-size: 0.875rem;
    color: var(--ck-gray-500);
    margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════════════════
   3. BADGES
   ═══════════════════════════════════════════════════════════════════ */

.ck-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--ck-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.ck-badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--ck-success);
}

.ck-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--ck-warning);
}

.ck-badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--ck-danger);
}

.ck-badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--ck-info);
}

.ck-badge-gold {
    background: var(--ck-grad-gold);
    color: var(--ck-navy);
}

.ck-badge-gray {
    background: var(--ck-gray-100);
    color: var(--ck-gray-700);
}

/* ═══════════════════════════════════════════════════════════════════
   4. FORMULAIRES
   ═══════════════════════════════════════════════════════════════════ */

.ck-form-group {
    margin-bottom: 20px;
}

.ck-label {
    display: block;
    font-family: var(--ck-font-title);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ck-navy);
    margin-bottom: 8px;
}

.ck-input,
.ck-textarea,
.ck-select {
    width: 100%;
    padding: 12px 16px;
    min-height: 48px;
    border: 2px solid var(--ck-gray-100);
    border-radius: var(--ck-radius);
    font-family: var(--ck-font-body);
    font-size: 1rem;
    color: var(--ck-dark);
    background: var(--ck-white);
    transition: all var(--ck-dur-fast) var(--ck-ease);
}

.ck-input:focus,
.ck-textarea:focus,
.ck-select:focus {
    outline: none;
    border-color: var(--ck-gold);
    box-shadow: 0 0 0 4px rgba(210, 154, 43, 0.15);
}

.ck-input::placeholder,
.ck-textarea::placeholder {
    color: var(--ck-gray-500);
    opacity: 0.7;
}

.ck-input:disabled {
    background: var(--ck-gray-100);
    cursor: not-allowed;
}

.ck-textarea {
    min-height: 120px;
    resize: vertical;
}

.ck-input-error {
    border-color: var(--ck-danger);
}

.ck-error-text {
    display: block;
    color: var(--ck-danger);
    font-size: 0.8rem;
    margin-top: 6px;
}

.ck-help-text {
    display: block;
    color: var(--ck-gray-500);
    font-size: 0.8rem;
    margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════════════
   5. ALERTES (flash messages)
   ═══════════════════════════════════════════════════════════════════ */

.ck-alert {
    padding: 14px 20px;
    border-radius: var(--ck-radius);
    margin-bottom: 16px;
    font-size: 0.95rem;
    border-left: 4px solid;
    animation: fade-in-down var(--ck-dur) var(--ck-ease-out);
}

.ck-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--ck-success);
    color: #065f46;
}

.ck-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--ck-danger);
    color: #991b1b;
}

.ck-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--ck-warning);
    color: #92400e;
}

.ck-alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--ck-info);
    color: #1e40af;
}

/* ═══════════════════════════════════════════════════════════════════
   6. AVATARS
   ═══════════════════════════════════════════════════════════════════ */

.ck-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--ck-radius-full);
    background: var(--ck-grad-gold);
    color: var(--ck-navy);
    font-family: var(--ck-font-title);
    font-weight: 700;
    font-size: 0.9rem;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--ck-white);
    box-shadow: var(--ck-shadow-sm);
}

.ck-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ck-avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
}

.ck-avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.4rem;
}

.ck-avatar-xl {
    width: 100px;
    height: 100px;
    font-size: 2rem;
}

/* ═══════════════════════════════════════════════════════════════════
   7. TOASTS (notifications)
   ═══════════════════════════════════════════════════════════════════ */

.ck-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.ck-toast {
    background: var(--ck-navy);
    color: var(--ck-white);
    padding: 14px 20px;
    border-radius: var(--ck-radius);
    border-left: 4px solid var(--ck-gold);
    box-shadow: var(--ck-shadow-lg);
    min-width: 280px;
    max-width: 400px;
    animation: toast-slide var(--ck-dur) var(--ck-ease-bounce);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ck-toast-success {
    border-left-color: var(--ck-success);
}

.ck-toast-error {
    border-left-color: var(--ck-danger);
}

.ck-toast-warning {
    border-left-color: var(--ck-warning);
}

.ck-toast.removing {
    animation: toast-slide-out var(--ck-dur) var(--ck-ease) forwards;
}

/* ═══════════════════════════════════════════════════════════════════
   8. PROGRESS BARS
   ═══════════════════════════════════════════════════════════════════ */

.ck-progress {
    height: 10px;
    background: var(--ck-gray-100);
    border-radius: var(--ck-radius-full);
    overflow: hidden;
    position: relative;
}

.ck-progress-fill {
    height: 100%;
    background: var(--ck-grad-gold);
    border-radius: var(--ck-radius-full);
    transition: width 0.6s var(--ck-ease-out);
    position: relative;
}

.ck-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

/* ═══════════════════════════════════════════════════════════════════
   9. SPINNER (chargement)
   ═══════════════════════════════════════════════════════════════════ */

.ck-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--ck-gray-100);
    border-top-color: var(--ck-gold);
    border-radius: 50%;
    animation: corty-spin 0.8s linear infinite;
}

.ck-spinner-lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
}