/* ========================================
   Card Theme System
   Theme-specific styles for digital business cards
   ======================================== */

/* ----------------------------------------
   CSS Variables for Theming
   ---------------------------------------- */
:root {
    /* Default Theme Variables */
    --theme-primary: #6366f1;
    --theme-primary-rgb: 99, 102, 241;
    
    /* Card Container */
    --card-border-radius: 1rem;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --card-background: white;
    
    /* Banner */
    --banner-height: 200px;
    --banner-border-radius: 1rem 1rem 0 0;
    --banner-gradient-angle: 135deg;
    
    /* Avatar */
    --avatar-size: 96px;
    --avatar-border-width: 4px;
    --avatar-border-radius: 50%;
    --avatar-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --avatar-offset: -48px;
    
    /* Typography */
    --title-font-size: 1.5rem;
    --title-font-weight: 800;
    --title-letter-spacing: -0.025em;
    --description-font-size: 0.875rem;
    --description-line-height: 1.6;
    
    /* Buttons */
    --button-border-radius: 0.75rem;
    --button-height: 48px;
    --button-shadow: 0 4px 14px 0 rgb(0 0 0 / 0.2);
    --button-font-weight: 700;
    
    /* Sections */
    --section-border-radius: 1rem;
    --section-padding: 1.25rem;
    --section-gap: 1rem;
    
    /* Social Links */
    --social-link-size: 48px;
    --social-link-border-radius: 50%;
    
    /* Contact Items */
    --contact-item-border-radius: 0.75rem;
    --contact-item-padding: 1rem;
    --contact-icon-size: 40px;
    
    /* Animation */
    --transition-duration: 0.2s;
    --hover-scale: 1.02;
    
    /* Glass Effect */
    --glass-blur: 10px;
    --glass-opacity: 0.8;
}

/* Dark mode adjustments */
.dark {
    --card-background: #1e1b2e;
}

/* ----------------------------------------
   Responsive Card Layout Utilities
   ---------------------------------------- */
.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Desktop Profile Card - Compact Mode */
@media (min-width: 768px) {
    .card-themed {
        --banner-height: 200px;
        --avatar-size: 80px;
        --avatar-offset: -40px;
        --title-font-size: 1.25rem;
        --description-font-size: 0.8125rem;
    }
}

/* ----------------------------------------
   Base Theme Styles
   ---------------------------------------- */
.card-themed {
    transition: all var(--transition-duration) ease;
}

.card-themed .card-banner {
    height: var(--banner-height);
    border-radius: var(--banner-border-radius);
    background: linear-gradient(var(--banner-gradient-angle), var(--theme-primary), color-mix(in srgb, var(--theme-primary) 70%, #8b5cf6));
}

.card-themed .card-avatar {
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: var(--avatar-border-radius);
    border-width: var(--avatar-border-width);
    box-shadow: var(--avatar-shadow);
    margin-top: var(--avatar-offset);
}

.card-themed .card-title {
    font-size: var(--title-font-size);
    font-weight: var(--title-font-weight);
    letter-spacing: var(--title-letter-spacing);
}

.card-themed .card-description {
    font-size: var(--description-font-size);
    line-height: var(--description-line-height);
}

.card-themed .card-button {
    height: var(--button-height);
    border-radius: var(--button-border-radius);
    box-shadow: var(--button-shadow);
    font-weight: var(--button-font-weight);
    background-color: var(--theme-primary);
    transition: all var(--transition-duration) ease;
}

.card-themed .card-button:hover {
    transform: scale(var(--hover-scale));
    filter: brightness(1.1);
}

.card-themed .card-section {
    border-radius: var(--section-border-radius);
    padding: var(--section-padding);
}

.card-themed .social-link {
    width: var(--social-link-size);
    height: var(--social-link-size);
    border-radius: var(--social-link-border-radius);
    transition: all var(--transition-duration) ease;
}

.card-themed .social-link:hover {
    transform: scale(var(--hover-scale));
}

.card-themed .contact-item {
    border-radius: var(--contact-item-border-radius);
    padding: var(--contact-item-padding);
    transition: all var(--transition-duration) ease;
}

.card-themed .contact-item:hover {
    transform: scale(var(--hover-scale));
}

.card-themed .contact-icon {
    width: var(--contact-icon-size);
    height: var(--contact-icon-size);
}

/* ----------------------------------------
   Theme: Default
   ---------------------------------------- */
.theme-default {
    --card-border-radius: 1rem;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --banner-border-radius: 1rem 1rem 0 0;
    --banner-gradient-angle: 135deg;
    --avatar-border-width: 4px;
    --avatar-border-radius: 50%;
    --title-font-weight: 800;
    --button-border-radius: 0.75rem;
    --button-height: 48px;
    --social-link-size: 48px;
    --social-link-border-radius: 50%;
    --contact-item-border-radius: 0.75rem;
    --transition-duration: 0.2s;
    --hover-scale: 1.02;
}

@media (min-width: 768px) {
    .theme-default {
        --banner-height: 200px;
        --avatar-size: 80px;
        --avatar-offset: -40px;
        --title-font-size: 1.25rem;
    }
}

/* ----------------------------------------
   Theme: Modern
   ---------------------------------------- */
.theme-modern {
    --card-border-radius: 1.5rem;
    --card-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --banner-height: 200px;
    --banner-border-radius: 1.5rem 1.5rem 0 0;
    --banner-gradient-angle: 120deg;
    --avatar-size: 110px;
    --avatar-border-width: 5px;
    --avatar-border-radius: 30%;
    --avatar-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.2);
    --avatar-offset: -55px;
    --title-font-size: 1.75rem;
    --title-font-weight: 900;
    --title-letter-spacing: -0.05em;
    --description-font-size: 0.9375rem;
    --button-border-radius: 1rem;
    --button-height: 52px;
    --social-link-size: 52px;
    --social-link-border-radius: 1rem;
    --contact-item-border-radius: 1rem;
    --contact-item-padding: 1.25rem;
    --contact-icon-size: 44px;
    --section-border-radius: 1.25rem;
    --transition-duration: 0.3s;
    --hover-scale: 1.03;
    --glass-blur: 20px;
    --glass-opacity: 0.85;
}

@media (min-width: 768px) {
    .theme-modern {
        --banner-height: 200px;
        --avatar-size: 90px;
        --avatar-offset: -45px;
        --title-font-size: 1.375rem;
    }
}

.theme-modern .glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .theme-modern .glass-card {
    background: rgba(30, 27, 46, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-modern .card-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
    border-radius: inherit;
}

.theme-modern .card-button {
    box-shadow: 0 10px 40px -10px var(--theme-primary);
}

.theme-modern .card-section,
.theme-modern .contact-item {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .theme-modern .card-section,
.dark .theme-modern .contact-item {
    background: rgba(45, 42, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.theme-modern .social-link {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.theme-modern .card-avatar {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 0 4px rgba(255, 255, 255, 0.5);
}

/* ----------------------------------------
   Theme: Classic
   ---------------------------------------- */
.theme-classic {
    --card-border-radius: 0.5rem;
    --card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --banner-height: 200px;
    --banner-border-radius: 0.5rem 0.5rem 0 0;
    --banner-gradient-angle: 180deg;
    --avatar-size: 88px;
    --avatar-border-width: 3px;
    --avatar-border-radius: 50%;
    --avatar-shadow: 0 2px 4px rgb(0 0 0 / 0.1);
    --avatar-offset: -44px;
    --title-font-size: 1.375rem;
    --title-font-weight: 700;
    --title-letter-spacing: 0;
    --description-font-size: 0.875rem;
    --description-line-height: 1.75;
    --button-border-radius: 0.5rem;
    --button-height: 44px;
    --button-shadow: 0 2px 4px rgb(0 0 0 / 0.1);
    --button-font-weight: 600;
    --social-link-size: 44px;
    --social-link-border-radius: 0.5rem;
    --contact-item-border-radius: 0.5rem;
    --contact-item-padding: 0.875rem;
    --contact-icon-size: 36px;
    --section-border-radius: 0.5rem;
    --section-padding: 1rem;
    --transition-duration: 0.15s;
    --hover-scale: 1.01;
}

@media (min-width: 768px) {
    .theme-classic {
        --banner-height: 200px;
        --avatar-size: 72px;
        --avatar-offset: -36px;
        --title-font-size: 1.125rem;
    }
}

.theme-classic .card-section,
.theme-classic .contact-item {
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

.dark .theme-classic .card-section,
.dark .theme-classic .contact-item {
    border: 1px solid #3d3a4b;
}

.theme-classic .card-banner {
    background: linear-gradient(180deg, var(--theme-primary), color-mix(in srgb, var(--theme-primary) 80%, black));
}

.theme-classic .social-link {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dark .theme-classic .social-link {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ----------------------------------------
   Theme: Minimal
   ---------------------------------------- */
.theme-minimal {
    --card-border-radius: 0;
    --card-shadow: none;
    --banner-height: 200px;
    --banner-border-radius: 0;
    --banner-gradient-angle: 90deg;
    --avatar-size: 80px;
    --avatar-border-width: 2px;
    --avatar-border-radius: 50%;
    --avatar-shadow: none;
    --avatar-offset: -40px;
    --title-font-size: 1.25rem;
    --title-font-weight: 600;
    --title-letter-spacing: 0.025em;
    --description-font-size: 0.8125rem;
    --description-line-height: 1.7;
    --button-border-radius: 0.25rem;
    --button-height: 40px;
    --button-shadow: none;
    --button-font-weight: 500;
    --social-link-size: 40px;
    --social-link-border-radius: 0.25rem;
    --contact-item-border-radius: 0.25rem;
    --contact-item-padding: 0.75rem;
    --contact-icon-size: 32px;
    --section-border-radius: 0.25rem;
    --section-padding: 0.75rem;
    --section-gap: 0.75rem;
    --transition-duration: 0.1s;
    --hover-scale: 1;
}

@media (min-width: 768px) {
    .theme-minimal {
        --banner-height: 200px;
        --avatar-size: 64px;
        --avatar-offset: -32px;
        --title-font-size: 1rem;
    }
}

.theme-minimal .card-section,
.theme-minimal .contact-item {
    background: transparent;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
}

.dark .theme-minimal .card-section,
.dark .theme-minimal .contact-item {
    border-bottom-color: #3d3a4b;
}

.theme-minimal .card-section:last-child,
.theme-minimal .contact-item:last-child {
    border-bottom: none;
}

.theme-minimal .card-button {
    border: 1px solid var(--theme-primary);
    background: transparent;
    color: var(--theme-primary);
}

.theme-minimal .card-button:hover {
    background: var(--theme-primary);
    color: white;
}

.theme-minimal .card-button.primary {
    background: var(--theme-primary);
    color: white;
}

.theme-minimal .social-link {
    background: transparent;
    border: 1px solid currentColor;
}

.theme-minimal .card-banner {
    background: var(--theme-primary);
}

.theme-minimal .card-avatar {
    border-color: var(--theme-primary);
}

/* ----------------------------------------
   Color Variations
   ---------------------------------------- */
.color-indigo { --theme-primary: #6366f1; --theme-primary-rgb: 99, 102, 241; }
.color-blue { --theme-primary: #3b82f6; --theme-primary-rgb: 59, 130, 246; }
.color-green { --theme-primary: #10b981; --theme-primary-rgb: 16, 185, 129; }
.color-amber { --theme-primary: #f59e0b; --theme-primary-rgb: 245, 158, 11; }
.color-red { --theme-primary: #ef4444; --theme-primary-rgb: 239, 68, 68; }
.color-pink { --theme-primary: #ec4899; --theme-primary-rgb: 236, 72, 153; }
.color-teal { --theme-primary: #14b8a6; --theme-primary-rgb: 20, 184, 166; }
.color-purple { --theme-primary: #8b5cf6; --theme-primary-rgb: 139, 92, 246; }

/* ----------------------------------------
   Utility Classes
   ---------------------------------------- */
.themed-bg-primary {
    background-color: var(--theme-primary);
}

.themed-text-primary {
    color: var(--theme-primary);
}

.themed-border-primary {
    border-color: var(--theme-primary);
}

.themed-shadow-primary {
    box-shadow: 0 10px 40px -10px rgba(var(--theme-primary-rgb), 0.5);
}

.themed-ring-primary {
    --tw-ring-color: rgba(var(--theme-primary-rgb), 0.5);
}

.theme-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-themed * {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: var(--transition-duration);
}

/* Equal Height Cards for Grid Layout */
.grid > div,
.grid > a {
    display: flex;
    flex-direction: column;
}

.grid .h-full {
    flex: 1;
}
