/* Custom Design System */

/* Default: Dark Mode */
:root {
    --primary: #28C4EA;
    --primary-dark: #1ea9ca;
    --primary-glow: rgba(40, 196, 234, 0.15);
    
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --bg-item: #282828;
    --border-item: #333333;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --white: #ffffff;
    --dark: #333333;
    
    /* Gradients */
    --page-gradient: radial-gradient(circle at top right, #24292e 0%, #0d0f12 100%);
    --btn-gradient: linear-gradient(135deg, #28C4EA 0%, #1ea9ca 100%);
    
    /* Shadows */
    --shadow-card: 0 20px 45px rgba(0, 0, 0, 0.5), 0 5px 20px rgba(0, 0, 0, 0.3);
    --shadow-avatar: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-button: 0 8px 24px rgba(40, 196, 234, 0.25);
    --shadow-button-hover: 0 12px 30px rgba(40, 196, 234, 0.35);
    
    /* Animation Speeds */
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.2s ease;
}

/* Light Mode Override */
body.light-mode {
    --bg-body: #f4f7f6;
    --bg-card: #ffffff;
    --bg-item: #f8fafc;
    --border-item: #edf2f7;
    --text-main: #333333;
    --text-muted: #666666;
    
    --page-gradient: radial-gradient(circle at top right, #fbfdfe 0%, #e2eff5 100%);
    --shadow-card: 0 20px 40px rgba(51, 51, 51, 0.08), 0 5px 15px rgba(0, 0, 0, 0.04);
    --shadow-avatar: 0 8px 20px rgba(51, 51, 51, 0.15);
    --shadow-button: 0 8px 24px rgba(40, 196, 234, 0.35);
    --shadow-button-hover: 0 12px 30px rgba(40, 196, 234, 0.45);
}

/* Reset and Base Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-body);
    background-image: var(--page-gradient);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.4s ease, color 0.4s ease;
}

/* Card Wrapper (for 3D tilt effect) */
.card-wrapper {
    width: 100%;
    max-width: 410px;
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

/* Main Digital Card */
.card {
    background: var(--bg-card);
    width: 100%;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

body.light-mode .card {
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Card Hover Interactions */
@media (hover: hover) {
    .card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-card);
    }
}

/* Banner Image Header */
.card-banner {
    height: 190px;
    background-size: cover;
    background-position: center;
    position: relative;
    width: 100%;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.45));
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.theme-toggle:active {
    transform: scale(0.95);
}

body.light-mode .theme-toggle {
    background: rgba(255, 255, 255, 0.85);
    color: var(--dark);
    border-color: rgba(51, 51, 51, 0.1);
    box-shadow: 0 4px 12px rgba(51, 51, 51, 0.08);
}

body.light-mode .theme-toggle:hover {
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(51, 51, 51, 0.15);
}

.icon-theme {
    width: 20px;
    height: 20px;
}

/* Avatar Position Row (Centered) */
.card-brand-row {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 24px;
    margin-top: -65px; /* Pull profile pic up over the banner */
    position: relative;
    z-index: 10;
}

/* Profile Picture: Round Avatar */
.profile-pic-container {
    width: 124px;
    height: 124px;
    border-radius: 50%;
    border: 4px solid var(--bg-card);
    background: var(--bg-card);
    overflow: hidden;
    box-shadow: var(--shadow-avatar);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

@media (hover: hover) {
    .profile-pic-container:hover {
        transform: scale(1.05) rotate(1.5deg);
    }
}

/* Card Body */
.card-body {
    padding: 24px 24px 32px 24px;
    display: flex;
    flex-direction: column;
}

/* Profile Info Text (Centered) */
.profile-info {
    margin-bottom: 24px;
    text-align: center;
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    transition: color 0.4s ease;
}

.profile-title {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 4px;
    letter-spacing: 0.2px;
    transition: color 0.4s ease;
}

.profile-company {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.2px;
    transition: color 0.4s ease;
}

/* Contact Links List */
.contact-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

/* Single Contact Method Link */
.contact-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 13px 18px;
    border-radius: 16px;
    background: var(--bg-item);
    border: 1px solid var(--border-item);
    transition: var(--transition-smooth);
}

.icon-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(40, 196, 234, 0.15);
}

.icon-container svg {
    transition: var(--transition-smooth);
}

.link-label {
    color: var(--text-main);
    font-size: 15.5px;
    font-weight: 500;
    word-break: break-all;
    line-height: 1.4;
    transition: color 0.4s ease;
}

/* Hover and Focus States for Links */
.contact-link:hover, .contact-link:focus {
    background: var(--bg-card);
    border-color: rgba(40, 196, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 196, 234, 0.12);
}

.contact-link:hover .icon-container, .contact-link:focus .icon-container {
    background-color: var(--primary-dark);
    transform: scale(1.06);
    box-shadow: 0 6px 14px rgba(40, 196, 234, 0.25);
}

.contact-link:active {
    transform: translateY(0);
    box-shadow: none;
}

/* CTA Container and Save Contact Button */
.cta-container {
    margin-top: auto;
}

.btn-save-contact {
    width: 100%;
    background: var(--btn-gradient);
    border: none;
    color: var(--white);
    padding: 16px 24px;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-button);
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn-save-contact::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 0;
    padding-bottom: 120%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.btn-save-contact:active::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    transition: 0s;
}

.btn-icon {
    transition: var(--transition-smooth);
}

/* Button Hover State */
.btn-save-contact:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-button-hover);
}

.btn-save-contact:hover .btn-icon {
    transform: translateY(2px);
}

.btn-save-contact:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-button);
}

/* Responsive adjustments for extra small screens */
@media (max-width: 380px) {
    body {
        padding: 12px;
    }
    
    .card-banner {
        height: 160px;
    }
    
    .card-brand-row {
        padding: 0 16px;
        margin-top: -50px;
    }
    
    .profile-pic-container {
        width: 100px;
        height: 100px;
    }
    
    .card-body {
        padding: 20px 16px 24px 16px;
    }
    
    .profile-name {
        font-size: 24px;
    }
    
    .profile-title {
        font-size: 16px;
    }
    
    .profile-company {
        font-size: 18px;
    }
    
    .link-label {
        font-size: 14.5px;
    }
}
