/* Components */

@keyframes scale-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--contrast);
    color: var(--text-primary);
    border-color: var(--contrast);
}

.btn-primary:hover {
    background: var(--contrast-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-contact {
    background: transparent !important;
    color: var(--contrast) !important;
    border: 2px solid var(--contrast) !important;
    animation: scale-pulse 1s infinite ease-in-out;
    border-radius: 32px;
}

.btn-contact:hover {
    background: var(--contrast-dim) !important;
    box-shadow: 0 0 15px var(--contrast);
    color: var(--contrast) !important;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    /* Removed fixed min-height to revert to standard flowing card */
    transform-style: preserve-3d;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
    z-index: 0;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card > * {
    position: relative;
    z-index: 1;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px; /* Reduced from 280px to make cards smaller */
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background-color: var(--bg-light); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 0;
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.card-image-wrapper.perfect-fit {
    height: 0;
    padding-bottom: 46.74%; /* 215/460 = 0.4674 - maintains exact aspect ratio */
    position: relative;
}

.card-image-wrapper.perfect-fit img {
    position: absolute;
    top: 0;
    left: 0;
}

.card-image-wrapper img {
    width: 100%;       
    height: 100%;      
    object-fit: cover; /* Cover ensures the area is filled */
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.card-image-wrapper.perfect-fit img {
    object-fit: contain;
}

.card-image-wrapper.with-blur-bg {
    height: 0;
    padding-bottom: 46.74%; /* Same aspect ratio as perfect-fit cards */
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

.card-image-wrapper.with-blur-bg img {
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.card:hover .card-image-wrapper img {
    transform: scale(1.1);
}

.card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--space-lg);
    z-index: 2;
    background: var(--bg-card); /* Ensure background is solid so text is readable */
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.card:hover .card-content {
    transform: none;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.card-status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.card-status.active { 
    color: var(--accent-secondary);
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.card-status.past { 
    color: var(--text-muted); 
}

.card-status.jam {
    color: var(--accent-tertiary);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.card .card-role {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-weight: 500;
    flex-grow: 0;
    line-height: 1.2;
}

.card h3 {
    margin-bottom: 24px;
    font-size: 1.35rem;
    margin-top: 0;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: var(--space-lg);
    flex-grow: 1;
    line-height: 1.7;
}

.card-platforms {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    margin-bottom: var(--space-sm);
}

.card-platforms img {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.card-platforms img.platform-windows {
    filter: brightness(0) saturate(100%) invert(100%);
}

.card:hover .card-platforms img {
    opacity: 1;
    transform: scale(1.1);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.card-tags span {
    font-size: 0.75rem;
    padding: 4px 10px; /* Smaller padding */
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.card:hover .card-tags span {
    background: rgba(232, 26, 26, 0.1);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

.card-year {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.card-link {
    font-weight: 500;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--contrast);
    transition: gap var(--transition-base);
}

.card-link:hover {
    gap: 12px;
}

.card-link .arrow {
    transition: transform var(--transition-base);
}

.card-link:hover .arrow {
    transform: translateX(4px);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-3xl);
    position: relative;
    margin-left: 64px;
}

.section-header h2 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    white-space: nowrap;
    position: relative;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--contrast);
    border-radius: 2px;
}

.section-header .line {
    flex: 1;
    height: 3px;
    background: linear-gradient(
        90deg, 
        var(--border-medium) 0%, 
        transparent 100%
    );
}

.social-links-hero {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-base);
    color: var(--text-muted);
    backdrop-filter: blur(10px);
}

.icon-link:hover {
    background: var(--contrast);
    border-color: var(--contrast);
    color: var(--text-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.social-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

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

.social-icon-sm {
    width: 24px;
    height: 24px;
}

a[href*="linkedin"] .social-icon,
a[href*="linkedin"] .social-icon-sm {
    filter: brightness(0) saturate(100%) invert(33%) sepia(97%) saturate(1582%) hue-rotate(188deg) brightness(95%) contrast(101%);
}

a[href*="linkedin"]:hover .social-icon,
a[href*="linkedin"]:hover .social-icon-sm {
    filter: brightness(0) saturate(100%) invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%);
}

@keyframes float-arrow {
    0%, 100% { transform: translateY(3px); }
    50% { transform: translateY(-3px); }
}

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(35, 35, 35, 0.6); /* Semi-transparent */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--contrast);
    border-color: var(--contrast);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(232, 26, 26, 0.5);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    animation: float-arrow 2s ease-in-out infinite;
}

.scroll-to-top:hover svg {
    animation: none;
    transform: translateY(-4px);
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: 15px;
    padding-left: 15px;
    border-left: 2px solid var(--border-medium);
}

.lang-separator {
    display: none; /* Handled by border-left above */
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 18px; /* Flag aspect ratio */
    overflow: visible;
    position: relative;
    transition: all 0.2s ease;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}

.lang-btn:hover, .lang-btn.active {
    opacity: 1;
    transform: scale(1.15);
}

.lang-btn.active img {
    box-shadow: 0 0 0 2px #ffffff;
}

.lang-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    border: 1px solid var(--border-medium);
    margin-top: 8px;
    z-index: 1005;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.lang-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background-color: var(--bg-card);
    border-left: 1px solid var(--border-medium);
    border-top: 1px solid var(--border-medium);
}

.lang-btn:hover .lang-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Gamification Stats (Hero Profile) */
.gamification-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 4px 0 8px 0;
    font-family: var(--font-mono);
    background: rgba(20, 20, 20, 0.6);
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-medium);
    width: fit-content;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    position: relative;
    backdrop-filter: blur(4px);
    border-left: 3px solid var(--contrast);
    animation: slideInStats 1s ease-out forwards;
    opacity: 0;
    transform: translateX(-20px);
}

@keyframes slideInStats {
    to { opacity: 1; transform: translateX(0); }
}

.stat-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    padding-right: 12px;
    border-right: 1px solid var(--border-medium);
}

.stat-level .label {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-level .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--contrast);
    text-shadow: 0 0 10px rgba(232, 26, 26, 0.4);
}

.stat-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 140px;
    padding: 2px 0;
}

.bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    position: relative;
    transition: width 1s ease-out;
}

.prog-bar .bar-fill {
    background: linear-gradient(90deg, #c0392b, #e74c3c);
    animation: fillProg 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.5s;
}

.design-bar .bar-fill {
    background: linear-gradient(90deg, #f39c12, #f1c40f);
    animation: fillDesign 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.7s;
}

.ui-bar .bar-fill {
    background: linear-gradient(90deg, #00ced1, #48d1cc); /* DarkTurquoise to MediumTurquoise */
    animation: fillUI 2s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.9s;
    box-shadow: 0 0 8px rgba(0, 206, 209, 0.4);
}

.class-badge {
    position: absolute;
    right: -8px;
    top: -8px;
    background: var(--contrast);
    color: white;
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 2px;
    font-weight: bold;
    letter-spacing: 0.5px;
    transform: rotate(10deg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 2;
}

@keyframes fillProg { from { width: 0%; } to { width: 91%; } }
@keyframes fillDesign { from { width: 0%; } to { width: 74%; } }
@keyframes fillUI { from { width: 0%; } to { width: 60%; } }

/* Profile Avatar Glitch Hover Effect */
.profile-avatar-wrapper {
    position: relative;
}

.profile-avatar-wrapper::after {
    content: 'GAME DEV';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: black;
    color: var(--contrast);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 8px;
    border: 1px solid var(--contrast);
    border-radius: 4px;
    opacity: 0;
    transition: all 0.3s ease;
}

.profile-avatar-wrapper:hover::after {
    opacity: 1;
    bottom: -15px;
}


@media (max-width: 768px) {
    .gamification-stats {
        margin: 4px auto 8px auto;
    }
}

