/* ===========================
   Variables CSS
   =========================== */
:root {
    /* Palette principale (inspirée du design) */
    --bg-primary: #001140;        /* Bleu marine profond */
    --bg-secondary: #001a5c;
    --accent-pink: #d91e6e;       /* Magenta/Rose vif */
    --accent-pink-hover: #ff2785;
    --text-white: #ffffff;
    --text-gray: #e0e7ff;
    --shadow-color: rgba(217, 30, 110, 0.3);
    --card-bg: var(--accent-pink);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-primary: #f5f7ff;
    --bg-secondary: #ffffff;
    --text-white: #001140;
    --text-gray: #4a5568;
    --shadow-color: rgba(0, 17, 64, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-sm);
    line-height: 1.6;
    transition: background 0.5s ease;
}

/* ===========================
   Container Principal
   =========================== */
.container {
    width: 100%;
    max-width: 480px;
    padding: var(--spacing-lg) var(--spacing-md);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    position: relative;
    animation: fadeIn 0.6s ease;
}

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

/* ===========================
   Header Controls
   =========================== */
.header-controls {
    display: flex;
    justify-content: flex-start;
    margin-bottom: var(--spacing-lg);
}

.icon-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: none;
    color: var(--text-white);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.icon-btn:active {
    transform: scale(0.95);
}

/* ===========================
   Profile Section
   =========================== */
.profile-section {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.profile-image-container {
    position: relative;
    display: inline-block;
    margin-bottom: var(--spacing-md);
}

.profile-image {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px var(--shadow-color);
    transition: transform var(--transition-medium);
}

.profile-image:hover {
    transform: scale(1.05);
}

.profile-handle {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.profile-bio {
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.7;
    max-width: 400px;
    margin: 0 auto;
}

.bio-highlight {
    color: var(--accent-pink-hover);
    font-weight: 500;
}

.badge {
    display: inline-block;
    background: var(--accent-pink);
    color: var(--text-white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: var(--spacing-xs);
    letter-spacing: 0.05em;
}

/* ===========================
   Links Section
   =========================== */
.links-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.link-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-md);
    background: var(--card-bg);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-white);
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.link-card:hover::before {
    left: 100%;
}

.link-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px var(--shadow-color);
    background: var(--accent-pink-hover);
}

.link-card:active {
    transform: translateY(-1px) scale(1);
}

.link-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Images d'icônes 3D */
.icon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform var(--transition-medium);
}

.link-card:hover .icon-image {
    transform: scale(1.1) rotate(5deg);
}

/* Icônes 3D - background transparent pour tous les logos */
.icon-3d,
.logo-icon {
    background: transparent !important;
    backdrop-filter: none !important;
    padding: 0;
    overflow: visible;
}

.link-icon.linkedin {
    background: rgba(14, 118, 168, 0.3);
}

.link-icon.twitter {
    background: rgba(0, 0, 0, 0.3);
}

.link-icon.calendar {
    background: rgba(59, 130, 246, 0.3);
}

.link-icon.whatsapp {
    background: rgba(37, 211, 102, 0.3);
}

.link-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.link-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
}

.link-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
}

.link-arrow {
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.link-card:hover .link-arrow {
    opacity: 1;
}

/* ===========================
   Footer Social Icons
   =========================== */
.footer-social {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.social-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 1.5rem;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.social-icon:hover {
    background: var(--accent-pink);
    border-color: var(--accent-pink);
    transform: scale(1.1) rotate(5deg);
}

.social-icon:active {
    transform: scale(0.95) rotate(0deg);
}

/* ===========================
   Analytics Badge
   =========================== */
.analytics-badge {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-gray);
    opacity: 0.85;
    padding: var(--spacing-md);
    margin-top: var(--spacing-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#totalClicks {
    font-weight: 700;
    color: var(--accent-pink-hover);
    font-size: 1.1rem;
    display: inline-block;
    transition: transform var(--transition-fast);
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 480px) {
    .container {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .profile-handle {
        font-size: 1.5rem;
    }
    
    .profile-bio {
        font-size: 0.9rem;
    }
    
    .link-card {
        padding: var(--spacing-sm) var(--spacing-sm);
    }
    
    .link-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1.2rem;
    }
    
    .link-title {
        font-size: 0.9rem;
    }
    
    .link-subtitle {
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .profile-image {
        width: 100px;
        height: 100px;
    }
    
    .profile-handle {
        font-size: 1.3rem;
    }
}

/* ===========================
   Animations supplémentaires
   =========================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.link-card {
    animation: slideIn 0.5s ease forwards;
}

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

/* Délais d'animation pour chaque carte */
.link-card:nth-child(1) { animation-delay: 0.1s; }
.link-card:nth-child(2) { animation-delay: 0.2s; }
.link-card:nth-child(3) { animation-delay: 0.3s; }
.link-card:nth-child(4) { animation-delay: 0.4s; }
.link-card:nth-child(5) { animation-delay: 0.5s; }

/* ===========================
   Dark/Light Theme Toggle
   =========================== */
[data-theme="light"] .link-card {
    color: var(--text-white);
    background: var(--accent-pink);
}

[data-theme="light"] .badge {
    background: var(--accent-pink);
    color: var(--text-white);
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .header-controls,
    .analytics-badge {
        display: none;
    }
    
    .link-card {
        break-inside: avoid;
    }
}

/* ===========================
   Accessibility
   =========================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible pour accessibilité clavier */
:focus-visible {
    outline: 3px solid var(--accent-pink-hover);
    outline-offset: 3px;
}
