/* Font Imports */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap');

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Custom Properties */
:root {
    /* Color System */
    --white: #ffffff;
    --black: #000000;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Radius System */
    --radius-none: 0;
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 20px;
    
    /* Font System */
    --font-inter: 'Inter', sans-serif;
    --font-poppins: 'Poppins', sans-serif;
    --font-roboto: 'Roboto', sans-serif;
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Light Theme Colors */
body[data-bg-type="light"] {
    --bg-primary: var(--white);
    --bg-secondary: var(--gray-50);
    --bg-tertiary: var(--gray-100);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-tertiary: var(--gray-400);
    --border-color: var(--gray-200);
    --hover-bg: var(--gray-50);
}

/* Dark Theme Colors */
body[data-bg-type="dark"] {
    --bg-primary: var(--gray-900);
    --bg-secondary: var(--gray-800);
    --bg-tertiary: var(--gray-700);
    --text-primary: var(--white);
    --text-secondary: var(--gray-300);
    --text-tertiary: var(--gray-400);
    --border-color: var(--gray-700);
    --hover-bg: var(--gray-800);
}

/* Auto Theme (System Preference) */
body[data-bg-type="auto"] {
    --bg-primary: var(--white);
    --bg-secondary: var(--gray-50);
    --bg-tertiary: var(--gray-100);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-tertiary: var(--gray-400);
    --border-color: var(--gray-200);
    --hover-bg: var(--gray-50);
}

@media (prefers-color-scheme: dark) {
    body[data-bg-type="auto"] {
        --bg-primary: var(--gray-900);
        --bg-secondary: var(--gray-800);
        --bg-tertiary: var(--gray-700);
        --text-primary: var(--white);
        --text-secondary: var(--gray-300);
        --text-tertiary: var(--gray-400);
        --border-color: var(--gray-700);
        --hover-bg: var(--gray-800);
    }
}

/* Border Radius Variants */
body[data-radius="none"] {
    --border-radius: var(--radius-none);
}

body[data-radius="small"] {
    --border-radius: var(--radius-small);
}

body[data-radius="medium"] {
    --border-radius: var(--radius-medium);
}

body[data-radius="large"] {
    --border-radius: var(--radius-large);
}

/* Font Family Variants */
body[data-font="inter"] {
    --font-family: var(--font-inter);
}

body[data-font="poppins"] {
    --font-family: var(--font-poppins);
}

body[data-font="roboto"] {
    --font-family: var(--font-roboto);
}

body[data-font="system"] {
    --font-family: var(--font-system);
}

/* Base Styles */
html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-secondary);
}

html::-webkit-scrollbar {
    width: 6px;
}

html::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

html::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Theme Controls */
.theme-controls {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 12px;
    z-index: 100;
}

.theme-toggle,
.share-button {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover,
.share-button:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.theme-toggle .dark-icon {
    display: none;
}

body[data-bg-type="dark"] .theme-toggle .light-icon {
    display: none;
}

body[data-bg-type="dark"] .theme-toggle .dark-icon {
    display: block;
}

/* Container */
.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Profile Container - Layout Variants */
.profile-container {
    width: 100%;
    max-width: 480px;
    animation: fadeInUp 0.8s ease-out;
}

body[data-layout="full"] .profile-container {
    max-width: 640px;
}

body[data-layout="compact"] .profile-container {
    max-width: 360px;
}

body[data-layout="card"] .profile-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: calc(var(--border-radius) * 2);
    padding: 32px;
    box-shadow: var(--shadow-xl);
}

/* Profile Header */
.profile-header {
    text-align: center;
    margin-bottom: 32px;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-primary);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-normal);
}

.avatar:hover {
    transform: scale(1.05);
}

.avatar-status {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #22c55e;
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.profile-bio {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Social Links */
.social-section {
    margin-bottom: 40px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.social-link {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.social-link:hover::before {
    opacity: 0.1;
}

.social-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.social-icon-img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

/* Main Links */
.links-section {
    margin-bottom: 32px;
}

.main-link {
    display: block;
    text-decoration: none;
    margin-bottom: 16px;
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s ease-out both;
}

.link-content {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.link-icon {
    width: 44px;
    height: 44px;
    border-radius: calc(var(--border-radius) * 0.75);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.link-icon-img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    display: block;
}

.link-action {
    color: var(--text-tertiary);
    font-size: 16px;
    transition: all var(--transition-normal);
}

.link-hover-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.main-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.main-link:hover .link-hover-effect {
    opacity: 0.04;
}

.main-link:hover .link-action {
    color: var(--primary-color);
    transform: translateX(2px);
}

.main-link:hover .link-icon {
    transform: scale(1.1);
}

/* Widgets Section */
.widgets-section {
    margin-bottom: 32px;
}

.widgets-container {
    padding: 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
}

/* Footer */
.profile-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.footer-text {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 16px;
    }
    
    body[data-layout="card"] .profile-container {
        padding: 24px;
    }
    
    .theme-controls {
        top: 16px;
        right: 16px;
    }
    
    .theme-toggle,
    .share-button {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
    
    .profile-name {
        font-size: 24px;
    }
    
    .profile-bio {
        font-size: 14px;
    }
    
    .avatar {
        width: 100px;
        height: 100px;
    }
    
    .link-content {
        padding: 16px 20px;
    }
    
    .link-title {
        font-size: 15px;
    }
    
    .social-links {
        gap: 12px;
    }
    
    .social-link {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    body[data-layout="card"] .profile-container {
        padding: 20px;
        margin: 8px;
    }
    
    .profile-header {
        margin-bottom: 24px;
    }
    
    .social-section {
        margin-bottom: 32px;
    }
    
    .link-content {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .link-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Focus Styles for Accessibility */
.theme-toggle:focus,
.share-button:focus,
.social-link:focus,
.main-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .theme-controls {
        display: none;
    }
    
    .profile-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
