/* Bubble Contact Buttons Style - Adapted from User Snippet */

.sidebar .contact-links-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Reduced gap slightly for sidebar compactness */
    margin-top: 15px;
}

.bubble-button {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 18px;
    /* Adjusted padding for sidebar */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-color);
    /* Matches theme text color */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Specific adjustment for light mode visibility */
body:not(.dark-theme) .bubble-button {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0.02) 100%);
    border: 1px solid rgba(37, 99, 235, 0.1);
    color: var(--text-color);
}

.bubble-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

body:not(.dark-theme) .bubble-button::before {
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
}

.bubble-button:hover::before {
    opacity: 1;
}

.bubble-button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
}

body:not(.dark-theme) .bubble-button:hover {
    border-color: rgba(37, 99, 235, 0.3);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
}

.bubble-button:active {
    transform: translateY(-2px) scale(0.98);
}

.icon-container {
    width: 40px;
    /* Smaller for sidebar */
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

body:not(.dark-theme) .icon-container {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0.05) 100%);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.bubble-button:hover .icon-container {
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.icon-container svg,
.icon-container img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    /* Ensure PNGs fit nicely */
    fill: currentColor;
}

body.dark-theme .icon-container svg {
    fill: white;
}

body:not(.dark-theme) .icon-container svg {
    fill: var(--primary);
}

/* Info Text */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    overflow: hidden;
    /* Prevent text overflow */
}

.contact-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.contact-detail {
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 300;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Specific Hover Colors */
.linkedin:hover {
    box-shadow: 0 8px 25px rgba(0, 119, 181, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.whatsapp:hover {
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.website:hover {
    box-shadow: 0 8px 25px rgba(100, 181, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.email:hover {
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Hover Text Effects */
.bubble-button:hover .contact-detail {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.linkedin:hover .contact-label,
.linkedin:hover .contact-detail {
    text-shadow: 0 0 12px rgba(0, 119, 181, 0.9);
    color: #0077b5;
}

body:not(.dark-theme) .linkedin:hover .contact-label,
body:not(.dark-theme) .linkedin:hover .contact-detail {
    color: #005e8f;
    /* Darker for light mode visibility */
    text-shadow: 0 0 5px rgba(0, 119, 181, 0.4);
}

.whatsapp:hover .contact-label,
.whatsapp:hover .contact-detail {
    text-shadow: 0 0 12px rgba(37, 211, 102, 0.9);
    color: #25d366;
}

body:not(.dark-theme) .whatsapp:hover .contact-label,
body:not(.dark-theme) .whatsapp:hover .contact-detail {
    color: #1a9446;
    text-shadow: 0 0 5px rgba(37, 211, 102, 0.4);
}

.website:hover .contact-label,
.website:hover .contact-detail {
    text-shadow: 0 0 12px rgba(100, 181, 246, 0.9);
    color: #64b5f6;
}

body:not(.dark-theme) .website:hover .contact-label,
body:not(.dark-theme) .website:hover .contact-detail {
    color: #1976d2;
    text-shadow: 0 0 5px rgba(100, 181, 246, 0.4);
}

.email:hover .contact-label,
.email:hover .contact-detail {
    text-shadow: 0 0 12px rgba(255, 152, 0, 0.9);
    color: #ff9800;
}

body:not(.dark-theme) .email:hover .contact-label,
body:not(.dark-theme) .email:hover .contact-detail {
    color: #e65100;
    text-shadow: 0 0 5px rgba(255, 152, 0, 0.4);
}

/* Animations Removed as per user request */
/*
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); } 
}

.bubble-button {
    animation: float 4s ease-in-out infinite;
}

.bubble-button:nth-child(2) { animation-delay: 0.5s; }
.bubble-button:nth-child(3) { animation-delay: 1.0s; }
.bubble-button:nth-child(4) { animation-delay: 1.5s; }
*/

/* 
   CREATIVE PROFILE IMAGE STYLE 
   Overrides the default .profile-img with a modern, gradient glow style
*/
.sidebar .profile-img {
    width: 180px;
    height: 180px;
    border-radius: 24px;
    /* Slightly softer square */
    margin: 0 auto 1.5rem;
    display: block;
    object-fit: cover;

    /* Creative Border using padding */
    padding: 3px;
    border: none;
    background: linear-gradient(135deg, var(--primary), #00c6ff);

    /* Glow effect - Softened */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1), 0 0 8px var(--primaryT);

    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.4s ease,
        border-radius 0.4s ease;
}

/* Dark theme specific adjustments later */
body.dark-theme .sidebar .profile-img {
    /* Softer glow in dark mode too */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 0 0 8px rgba(96, 165, 250, 0.5);
}

/* 
   RML LOGO HEADER ANIMATION AND STYLE
   Enhances the .logo class with a creative shape and rotation animation on hover
*/
.logo {
    /* Base styles override */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    /* Circular shape as requested */
    background: linear-gradient(135deg, var(--primary), #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    cursor: pointer;

    /* Creative border/glow */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1), inset 0 0 0 2px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    margin: 0;
    /* Reset margins to prevent shifts */
    flex-shrink: 0;
    /* Prevent squishing */
    line-height: 1;
    /* Center text vertically */

    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Explicitly hide desktop links on mobile to prevent spacing issues */
@media (max-width: 768px) {
    .nav-links {
        display: none !important;
    }
}

/* Glass shine effect */
.logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: rotate(45deg);
    transition: all 0.5s;
}

.logo:hover {
    transform: rotate(360deg) scale(1.1);
    /* Morphs to circle on spin */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 10px var(--primaryT);
    background: linear-gradient(135deg, #00c6ff, var(--primary));
}

.logo:hover::before {
    left: 100%;
    transition: 0.7s;
}

/* Click Animation Class */
@keyframes spinClick {
    0% {
        transform: rotate(0deg) scale(1.1);
    }

    100% {
        transform: rotate(360deg) scale(1.1);
    }
}

.logo.spin-click {
    animation: spinClick 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 50%;
    /* Ensure it's circular during spin */
}

/* Scroll to Top Button for Mobile */
/* Scroll to Top Button for Mobile */
.scroll-top-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: #0f172a;
    /* Darker background */
    color: #38bdf8;
    /* Cyan icon */
    border: 1px solid rgba(56, 189, 248, 0.3);
    /* Subtle tech border */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 1400;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    overflow: hidden;
    /* For scan effect */
}

/* Light Theme Override for Scroll Top Button */
body:not(.dark-theme) .scroll-top-btn {
    background: #ffffff;
    /* White background */
    color: var(--primary);
    /* Primary Blue icon */
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Subtle border */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

body:not(.dark-theme) .scroll-top-btn:active {
    border-color: var(--primary);
    background: #f0f9ff;
}

body:not(.dark-theme) .scroll-top-btn::after {
    background: linear-gradient(to top, transparent, rgba(37, 99, 235, 0.2), transparent);
    /* Blue scan effect */
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:active {
    transform: scale(0.95);
    border-color: #38bdf8;
}

.scroll-top-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    z-index: 2;
    /* Above scan effect */
}

/* Scan Effect */
.scroll-top-btn::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, transparent, rgba(56, 189, 248, 0.4), transparent);
    animation: scanUp 2.5s infinite ease-in-out;
    z-index: 1;
}

@keyframes scanUp {
    0% {
        top: 100%;
    }

    50% {
        top: -100%;
    }

    100% {
        top: -100%;
    }
}

/* Click Animation (Ripple) */
@keyframes ripple-effect {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
    }

    100% {
        box-shadow: 0 0 0 20px rgba(56, 189, 248, 0);
    }
}

.scroll-top-btn.clicked {
    animation: ripple-effect 0.6s ease-out;
}

/* Hide on desktop since user requested "para la version movil" */
@media (min-width: 769px) {
    .scroll-top-btn {
        display: none;
    }
}