/* ===========================
   Firebase Analytics Components
   =========================== */

/* CV Download Section */
.cv-download-section {
    text-align: center;
    margin: var(--space-xl) 0;
    padding: var(--space-2xl);
    background: rgba(var(--color-surface-rgb), 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(var(--color-primary-rgb), 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cv-download-section h3 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--space-xl);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.download-buttons {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
}

.download-buttons .btn {
    min-width: 180px;
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.download-buttons .btn::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.6s ease;
}

.download-buttons .btn:hover::before {
    left: 100%;
}

.download-buttons .btn i {
    margin-right: var(--space-sm);
    font-size: 1.1em;
}

/* Download Button States */
.btn.downloading {
    opacity: 0.8;
    pointer-events: none;
    background: var(--color-primary) !important;
    color: white !important;
}

.btn.downloading i {
    animation: spin 1s linear infinite;
}

.btn.downloaded {
    background: #4CAF50 !important;
    color: white !important;
    transform: translateY(-2px) scale(1.05);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Notification Styles */
.download-notification {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    user-select: none;
}

.download-notification:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

.notification-success {
    background: linear-gradient(135deg, #4CAF50, #45a049) !important;
}

.notification-error {
    background: linear-gradient(135deg, #f44336, #d32f2f) !important;
}

.notification-info {
    background: linear-gradient(135deg, #2196F3, #1976D2) !important;
}

/* Stats Panel */
#download-stats {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#download-stats strong {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* Social Media Tracking Styles */
.social-links a {
    transition: all 0.3s ease;
    position: relative;
}

.social-links a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--color-primary-rgb), 0.1);
    opacity: 0;
    border-radius: inherit;
    transition: opacity 0.3s ease;
}

.social-links a:hover::after {
    opacity: 1;
}

/* Contact Form Analytics */
form[data-form-type] {
    position: relative;
}

form[data-form-type]::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

form[data-form-type]:focus-within::before {
    opacity: 0.1;
}

/* Project Card Analytics Enhancement */
.project-card[data-analytics] {
    position: relative;
}

.project-card[data-analytics]::after {
    content: '👁️';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card[data-analytics]:hover::after {
    opacity: 0.5;
}

/* Skill Category Analytics */
.skill-item[data-category] {
    cursor: pointer;
}

.skill-item[data-category]:hover {
    transform: translateY(-8px) scale(1.03);
}

/* Loading States */
.loading-analytics {
    position: relative;
    overflow: hidden;
}

.loading-analytics::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--color-primary-rgb), 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Analytics Debug Mode */
.analytics-debug {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: #00ff00;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 11px;
    z-index: 10000;
    border: 1px solid #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cv-download-section {
        padding: var(--space-xl);
        margin: var(--space-lg) 0;
    }

    .download-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
    }

    .download-buttons .btn {
        width: 100%;
        max-width: 280px;
        min-width: auto;
    }

    .download-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 13px;
    }

    #download-stats {
        top: auto;
        bottom: 10px;
        right: 10px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .cv-download-section {
        padding: var(--space-lg);
    }

    .cv-download-section h3 {
        font-size: var(--font-size-xl);
    }

    .download-buttons .btn {
        padding: var(--space-sm) var(--space-lg);
        font-size: var(--font-size-sm);
    }

    .download-notification {
        padding: 12px 15px;
        font-size: 12px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .cv-download-section {
        background: rgba(var(--color-surface-rgb), 0.8);
        border-color: rgba(var(--color-primary-rgb), 0.2);
    }

    .download-notification {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    #download-stats {
        background: rgba(0, 0, 0, 0.95) !important;
        border-color: rgba(255, 255, 255, 0.3);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
    .download-buttons .btn {
        border: 2px solid currentColor;
    }

    .download-notification {
        border: 2px solid white;
    }

    #download-stats {
        border: 2px solid #00ff00;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .btn.downloading i {
        animation: none;
    }

    .loading-analytics::before {
        animation: none;
    }

    .download-notification {
        animation: none !important;
    }

    .download-buttons .btn::before {
        transition: none;
    }
}
