/**
 * WPIdentity Sync Pro - Frontend Styles
 * 
 * @package WPIdentitySyncPro
 * @version 2.0.0
 */

/* Base Card Styles */
.wpidentity-card {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.wpidentity-card *,
.wpidentity-card *::before,
.wpidentity-card *::after {
    box-sizing: inherit;
}

.wpidentity-card img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Theme Variations */
.wpidentity-theme-light {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    color: #2c3e50;
}

.wpidentity-theme-dark {
    background: #2c3e50;
    border: 1px solid #34495e;
    color: #ecf0f1;
}

.wpidentity-theme-auto {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    color: #2c3e50;
}

@media (prefers-color-scheme: dark) {
    .wpidentity-theme-auto {
        background: #2c3e50;
        border: 1px solid #34495e;
        color: #ecf0f1;
    }
}

/* Size Variations */
.wpidentity-size-small {
    font-size: 0.9em;
}

.wpidentity-size-medium {
    font-size: 1em;
}

.wpidentity-size-large {
    font-size: 1.1em;
}

/* Classic Card (Card 1) */
.wpidentity-card-classic {
    max-width: 320px;
    margin: 0 auto 20px;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wpidentity-card-classic:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.wpidentity-card-classic .wpidentity-avatar {
    margin-bottom: 20px;
}

.wpidentity-card-classic .wpidentity-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
    border: 3px solid rgba(102, 126, 234, 0.2);
    transition: border-color 0.3s ease;
}

.wpidentity-card-classic:hover .wpidentity-avatar img {
    border-color: rgba(102, 126, 234, 0.4);
}

.wpidentity-card-classic .wpidentity-name {
    margin: 0 0 10px 0;
    font-size: 1.4em;
    font-weight: 600;
    line-height: 1.3;
}

.wpidentity-card-classic .wpidentity-bio {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
    opacity: 0.8;
}

/* Horizontal Card (Card 2) */
.wpidentity-card-horizontal {
    max-width: 450px;
    margin: 0 auto 20px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wpidentity-card-horizontal:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.wpidentity-card-horizontal .wpidentity-card-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.wpidentity-card-horizontal .wpidentity-avatar {
    flex-shrink: 0;
}

.wpidentity-card-horizontal .wpidentity-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: border-color 0.3s ease;
}

.wpidentity-card-horizontal:hover .wpidentity-avatar img {
    border-color: rgba(102, 126, 234, 0.4);
}

.wpidentity-card-horizontal .wpidentity-content {
    flex: 1;
    min-width: 0;
}

.wpidentity-card-horizontal .wpidentity-name {
    margin: 0 0 8px 0;
    font-size: 1.3em;
    font-weight: 600;
    line-height: 1.3;
}

.wpidentity-card-horizontal .wpidentity-bio {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
    opacity: 0.8;
}

/* Hero Card (Card 3) */
.wpidentity-card-hero {
    max-width: 350px;
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wpidentity-card-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.wpidentity-card-hero .wpidentity-header {
    position: relative;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.wpidentity-card-hero .wpidentity-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="hero-pattern" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23hero-pattern)"/></svg>');
}

.wpidentity-card-hero .wpidentity-avatar {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.wpidentity-card-hero .wpidentity-avatar img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.wpidentity-card-hero:hover .wpidentity-avatar img {
    transform: scale(1.05);
}

.wpidentity-card-hero .wpidentity-body {
    padding: 50px 20px 25px;
    text-align: center;
}

.wpidentity-card-hero .wpidentity-name {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    font-weight: 600;
    line-height: 1.3;
}

.wpidentity-card-hero .wpidentity-bio {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
    opacity: 0.8;
}

/* Source Indicator */
.wpidentity-source-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.wpidentity-card:hover .wpidentity-source-indicator {
    opacity: 0.6;
}

.wpidentity-source-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.wpidentity-card[data-source="manual"] .wpidentity-source-dot {
    background: #e74c3c;
}

.wpidentity-card[data-source="gravatar_api"] .wpidentity-source-dot {
    background: #27ae60;
}

.wpidentity-card[data-source="gravatar_standard"] .wpidentity-source-dot {
    background: #f39c12;
}

/* Dark Theme Adjustments */
.wpidentity-theme-dark .wpidentity-name {
    color: #ecf0f1;
}

.wpidentity-theme-dark .wpidentity-bio {
    color: #bdc3c7;
}

.wpidentity-theme-dark .wpidentity-card-hero .wpidentity-header {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
}

@media (prefers-color-scheme: dark) {
    .wpidentity-theme-auto .wpidentity-name {
        color: #ecf0f1;
    }
    
    .wpidentity-theme-auto .wpidentity-bio {
        color: #bdc3c7;
    }
    
    .wpidentity-theme-auto .wpidentity-card-hero .wpidentity-header {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    }
}

/* Size Adjustments */
.wpidentity-size-small .wpidentity-card-classic {
    max-width: 280px;
    padding: 20px;
}

.wpidentity-size-small .wpidentity-card-classic .wpidentity-avatar img {
    width: 80px;
    height: 80px;
}

.wpidentity-size-small .wpidentity-card-horizontal {
    max-width: 380px;
    padding: 15px;
}

.wpidentity-size-small .wpidentity-card-horizontal .wpidentity-avatar img {
    width: 60px;
    height: 60px;
}

.wpidentity-size-small .wpidentity-card-hero {
    max-width: 300px;
}

.wpidentity-size-small .wpidentity-card-hero .wpidentity-avatar img {
    width: 60px;
    height: 60px;
}

.wpidentity-size-large .wpidentity-card-classic {
    max-width: 380px;
    padding: 30px;
}

.wpidentity-size-large .wpidentity-card-classic .wpidentity-avatar img {
    width: 120px;
    height: 120px;
}

.wpidentity-size-large .wpidentity-card-horizontal {
    max-width: 520px;
    padding: 25px;
}

.wpidentity-size-large .wpidentity-card-horizontal .wpidentity-avatar img {
    width: 100px;
    height: 100px;
}

.wpidentity-size-large .wpidentity-card-hero {
    max-width: 400px;
}

.wpidentity-size-large .wpidentity-card-hero .wpidentity-avatar img {
    width: 80px;
    height: 80px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wpidentity-card-classic,
    .wpidentity-card-horizontal,
    .wpidentity-card-hero {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .wpidentity-card-horizontal .wpidentity-card-inner {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .wpidentity-card-horizontal .wpidentity-content {
        padding-left: 0;
    }
}

@media (max-width: 480px) {
    .wpidentity-card-classic {
        padding: 20px 15px;
    }
    
    .wpidentity-card-classic .wpidentity-avatar img {
        width: 80px;
        height: 80px;
    }
    
    .wpidentity-card-horizontal {
        padding: 15px;
    }
    
    .wpidentity-card-horizontal .wpidentity-avatar img {
        width: 60px;
        height: 60px;
    }
    
    .wpidentity-card-hero .wpidentity-body {
        padding: 45px 15px 20px;
    }
    
    .wpidentity-card-hero .wpidentity-avatar img {
        width: 60px;
        height: 60px;
    }
}

/* Loading States */
.wpidentity-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.wpidentity-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: wpidentity-spin 1s linear infinite;
    z-index: 10;
}

@keyframes wpidentity-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility Improvements */
.wpidentity-card img[alt=""] {
    opacity: 0.7;
}

.wpidentity-card:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wpidentity-card {
        border-width: 2px;
    }
    
    .wpidentity-card-classic .wpidentity-avatar img,
    .wpidentity-card-horizontal .wpidentity-avatar img,
    .wpidentity-card-hero .wpidentity-avatar img {
        border-width: 3px;
        border-color: currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .wpidentity-card,
    .wpidentity-card *,
    .wpidentity-card::before,
    .wpidentity-card::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print Styles */
@media print {
    .wpidentity-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .wpidentity-source-indicator {
        display: none;
    }
}