html {
    box-sizing: border-box;
}
*, *::before, *::after {
    box-sizing: inherit;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --accent: #3b82f6;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --border: rgba(15, 23, 42, 0.08);
    --glow: rgba(37, 99, 235, 0.08);
    --shadow-light: rgba(15, 23, 42, 0.04);
    --shadow-medium: rgba(15, 23, 42, 0.08);
    --shadow-heavy: rgba(15, 23, 42, 0.12);
    --bg-color: #f8fafc;
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color); /* Ensuring html also has the background color */
}

body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 40px 20px;
    background-color: var(--bg-color);
    position: relative;
    overflow-y: auto;
    flex: 1 0 auto;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.interface-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 520px;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 2px 4px rgba(15, 23, 42, 0.04),
        0 8px 16px rgba(15, 23, 42, 0.04),
        0 16px 24px rgba(15, 23, 42, 0.04),
        0 24px 32px rgba(15, 23, 42, 0.01);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    margin: auto;
}

.interface-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary) 100%);
    z-index: 2;
    pointer-events: none;
    box-sizing: border-box;
}

.interface-panel:hover {
    background: var(--surface-hover);
    transform: translateY(-4px);
    box-shadow: 
        0 4px 8px rgba(15, 23, 42, 0.06),
        0 12px 24px rgba(15, 23, 42, 0.06),
        0 24px 32px rgba(15, 23, 42, 0.06),
        0 32px 48px rgba(15, 23, 42, 0.02);
}

.system-header {
    position: absolute;
    top: 28px;
    right: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.connection-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    position: relative;
}

.profile-core {
    position: relative;
    margin-bottom: 48px;
    text-align: center;
    z-index: 3;
}

.avatar-container {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    background: var(--surface);
    border: 3px solid var(--primary);
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
}

.avatar-container:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.2);
    border-color: var(--primary-light);
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.primary-name {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.025em;
    position: relative;
    line-height: 1.1;
    text-rendering: optimizeLegibility;
}

.role-title {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 500;
    letter-spacing: 0.015em;
    line-height: 1.4;
}

.location-info {
    font-size: 1rem;
    color: var(--text-tertiary);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-weight: 500;
}

.credentials-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 48px;
    position: relative;
    z-index: 3;
}

.credentials-section::after {
    content: '';
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.credential-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.credential-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.03), transparent);
    transition: left 0.6s ease;
}

.credential-item:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(15, 23, 42, 0.06),
        0 2px 6px rgba(15, 23, 42, 0.04);
    background: var(--surface-hover);
    border-color: rgba(37, 99, 235, 0.15);
}

.credential-item:hover::before {
    left: 100%;
}

.credential-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.education-icon {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.work-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
    line-height: 1;
    position: relative;
    top: -2px; /* Increased adjustment to better center the infinity symbol */
    font-size: 1.6rem; /* Slightly larger to ensure proper centering */
}

.credential-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.credential-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.credential-place {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.credential-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.credential-link:hover {
    color: var(--primary-dark);
    border-bottom: 1px solid var(--primary);
    text-decoration: none;
}

.credential-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

.location-marker {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    position: relative;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.location-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.contact-interface {
    margin-bottom: 40px;
    z-index: 3;
    position: relative;
}

.contact-interface::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.email-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
    font-size: 1rem;
    letter-spacing: 0.01em;
    gap: 10px;
    box-shadow: 
        0 1px 3px rgba(15, 23, 42, 0.04),
        0 1px 2px rgba(15, 23, 42, 0.06);
}

.email-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 
        0 2px 8px rgba(15, 23, 42, 0.08),
        0 1px 4px rgba(15, 23, 42, 0.06);
}

.email-icon {
    font-size: 1.2rem;
    display: inline-block;
}

.social-network {
    margin-bottom: 36px;
    position: relative;
    z-index: 3;
}

.social-links-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    position: relative;
}

.social-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    box-shadow: 
        0 1px 3px rgba(15, 23, 42, 0.04),
        0 1px 2px rgba(15, 23, 42, 0.06);
}

.link-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Ensure all social-link buttons have centered content */
.social-link .link-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

.link-icon {
    width: 22px;
    height: 22px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.link-label {
    transition: transform 0.3s ease;
}

.link-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0) 70%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    transform: translate(-50%, -50%) scale(0.5);
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

/* Hover effects */
.social-link:hover {
    color: white;
    transform: translateY(-1px);
    box-shadow: 
        0 2px 8px rgba(15, 23, 42, 0.08),
        0 1px 4px rgba(15, 23, 42, 0.06);
    border-color: var(--primary);
    background: var(--primary);
}

.social-link:hover::before {
    opacity: 1;
}

.social-link:hover .link-icon {
    transform: scale(1.05);
}

.social-link:hover .link-shine {
    opacity: 0;
}

/* Specific styling for each button */
.cv-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px;
    background: rgba(15, 23, 42, 0.02);
    border-radius: 18px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1.5px solid var(--border);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: none;
    margin-bottom: 0;
}

.cv-link:hover {
    color: white;
    transform: translateY(-1px);
    box-shadow: 
        0 2px 8px rgba(15, 23, 42, 0.08),
        0 1px 4px rgba(15, 23, 42, 0.06);
    border-color: var(--primary);
    background: var(--primary);
}

.linkedin-link {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(14, 118, 168, 0.1);
}

.github-link {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(36, 41, 47, 0.1);
}

.document-access {
    text-align: center;
    z-index: 3;
    position: relative;
}

.cv-link .cv-icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cv-link:hover .cv-icon {
    transform: scale(1.05);
}

.cv-link .link-label {
    position: relative;
    z-index: 1;
    text-align: center !important; /* Ensures wrapped text within the label is centered */
}

/* Constrain text width for better readability */
.interface-panel p, 
.interface-panel .location-info,
.credential-details {
    max-width: 65ch; /* Limit text width for better readability */
}

/* Enhance horizontal spacing on the largest screens */
@media (min-width: 1200px) {
    .interface-panel {
        padding: 80px 70px;
    }
    
    .avatar-container {
        width: 130px;
        height: 130px;
    }
    
    .primary-name {
        font-size: 3.2rem;
    }
}

/* Media queries for responsive design */
@media (min-width: 992px) {
    /* Enhance layout for wider screens */
    .interface-panel {
        padding: 70px 60px;
        max-width: 780px; /* Wider panel for horizontal layouts */
    }

    .credentials-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    
    .social-links-wrapper {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 20px;
    }
    
    /* Optional horizontal info panel */
    .info-panel {
        display: flex;
        align-items: center;
        margin-bottom: 40px;
    }
    
    .info-panel .avatar-container {
        margin: 0 40px 0 0;
        width: 120px;
        height: 120px;
    }
    
    .info-panel .profile-text {
        text-align: left;
    }
    
    /* Enhanced social links on larger screens */
    .social-link {
        padding: 18px 16px;
    }
}

@media (max-width: 991px) and (min-width: 641px) {
    /* Tablet-sized screens */
    .interface-panel {
        padding: 60px 40px;
        max-width: 640px;
    }
    
    .social-links-wrapper {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 30px 20px; /* Ensure there's space above and below */
    }
    
    .interface-panel {
        padding: 50px 30px;
        margin: 0;
        border-radius: 32px;
        max-height: none; /* Remove fixed height constraint */
    }
    
    .primary-name {
        font-size: 2.4rem;
    }
    
    .role-title {
        font-size: 1.1rem;
    }
    
    .location-info {
        font-size: 0.9rem;
        margin-bottom: 30px;
    }
    
    .credentials-section {
        gap: 16px;
        margin-bottom: 36px;
    }
    
    .credential-item {
        padding: 12px 16px;
    }
    
    .credential-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
    
    .email-primary {
        padding: 16px 24px;
        font-size: 1rem;
    }
    
    .social-links-wrapper {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .social-link {
        padding: 16px;
    }
    
    .avatar-container {
        width: 90px;
        height: 90px;
        margin-bottom: 24px;
        border-radius: 22px;
    }
    
    .system-header {
        top: 20px;
        right: 20px;
    }
}
        
@media (max-width: 400px) {
    .container {
        padding: 20px 15px; /* Slightly reduced padding for very small screens */
    }
    
    .interface-panel {
        padding: 30px 20px;
        border-radius: 28px;
    }
    
    .primary-name {
        font-size: 2rem;
    }
    
    .location-info {
        margin-bottom: 24px;
    }
    
    .credentials-section {
        gap: 12px;
        margin-bottom: 30px;
    }
    
    .credential-item {
        padding: 10px 14px;
    }
    
    .credential-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        border-radius: 10px;
    }
    
    .credential-title {
        font-size: 0.95rem;
    }
    
    .credential-place {
        font-size: 0.85rem;
    }
    
    /* More compact social links */
    .social-link {
        padding: 14px 12px;
    }
    
    .link-content {
        gap: 8px;
    }
    
    .link-label {
        font-size: 0.9rem;
    }
}

/* Simple page entrance without layout shifts */
@keyframes simpleInitialize {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes simpleFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.interface-panel {
    animation: simpleInitialize 0.6s ease-out;
}
        
.profile-core, .credentials-section, .contact-interface, .social-network, .document-access {
    animation: simpleFadeIn 0.4s ease-out forwards;
    opacity: 0;
}
        
.profile-core { animation-delay: 0.1s; }
.credentials-section { animation-delay: 0.2s; }
.contact-interface { animation-delay: 0.3s; }
.social-network { animation-delay: 0.4s; }
.document-access { animation-delay: 0.5s; }

/* Typography refinements */
.interface-panel * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes professionalRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.profile-text {
    text-align: center; /* Default for mobile */
    transition: all 0.4s ease;
}

/* By default, info-panel is vertical */
.info-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 48px;
}

@media (min-width: 992px) {
    /* On large screens, make .info-panel horizontal */
    .info-panel {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        gap: 40px;
    }
    
    /* Adjust elements for horizontal layout */
    .info-panel .profile-text {
        text-align: left;
    }
    
    .info-panel .location-info {
        justify-content: flex-start; /* Align to left in horizontal layout */
    }
}

/* Enhance animation for the credentials section in grid layout */
@media (min-width: 992px) {
    .credentials-section .credential-item:hover {
        transform: translateY(-5px) scale(1.02);
        box-shadow: 0 15px 30px rgba(37, 99, 235, 0.18);
    }
}

/* Ensure forms and inputs are styled consistently */
input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Add styles for links to ensure consistent hover effects */
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}
