:root {
    --background-color: #cd94ff;
    --text-color: #333;
    --card-background: rgba(230, 220, 250, 0.4);
    --card-border: rgba(255, 255, 255, 0.8);
    --subtitle-color: #555;
    --link-background: rgba(230, 220, 250, 0.6);
    --link-hover-background: rgba(230, 220, 250, 0.8);
    --box-shadow-color: rgba(1, 19, 44, 0.384);
    --box-shadow-hover-color: rgba(1, 19, 44, 0.45);
    --social-icon-box-shadow-color: rgba(0, 0, 0, 0.15);
}

.dark-mode {
    --background-color: #2c004f;
    --text-color: #eee;
    --card-background: rgba(50, 20, 80, 0.4);
    --card-border: rgba(255, 255, 255, 0.2);
    --subtitle-color: #aaa;
    --link-background: rgba(50, 20, 80, 0.6);
    --link-hover-background: rgba(50, 20, 80, 0.8);
    --box-shadow-color: rgba(255, 255, 255, 0.1);
    --box-shadow-hover-color: rgba(255, 255, 255, 0.15);
    --social-icon-box-shadow-color: rgba(255, 255, 255, 0.1);
}

.special-theme {
    --background-color: #ba67ff;
    --text-color: #000000;
    --card-background: rgba(253, 161, 161, 0.8);
    --card-border: rgba(0, 0, 0, 0.8);
    --subtitle-color: #000000;
    --link-background: rgb(255, 255, 255);
    --link-hover-background: rgba(255, 255, 255, 0.8);
    --box-shadow-color: rgba(0, 0, 0, 0.2);
    --box-shadow-hover-color: rgba(0, 0, 0, 0.3);
    --social-icon-box-shadow-color: rgba(0, 0, 0, 0.2);
}

@font-face {
    font-family: 'Stopbuck';
    src: url('Fuentes/Stopbuck.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

* {
    font-family: 'Stopbuck', sans-serif;
}

body {
    margin: 0;
    color: var(--text-color);
    background-color: var(--background-color);
    background-image:  radial-gradient(#eedaff 2px, transparent 2px), radial-gradient(#eedaff 2px, var(--background-color) 2px);
    background-size: 40px 40px;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    word-wrap: break-word;
}

#open-menu-button {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 15px;
    border-radius: 20px;
    border: 2px solid var(--card-border);
    background-color: var(--card-background);
    color: var(--text-color);
    cursor: pointer;
    z-index: 1000;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#open-menu-button:hover {
    background-color: var(--link-hover-background);
    transform: translateY(-2px);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.customization-menu {
    background-color: var(--card-background);
    border: 2px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-overlay.active .customization-menu {
    transform: translateY(0);
    opacity: 1;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
}

.menu-section {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.menu-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: var(--text-color);
}

.theme-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background-color: var(--card-background);
    border-radius: 15px;
    cursor: pointer;
    border: 2px solid var(--card-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 3px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.theme-switch:hover {
    background-color: var(--link-hover-background);
    border-color: var(--link-hover-background);
}

.switch-thumb {
    width: 24px;
    height: 24px;
    background-color: var(--text-color);
    border-radius: 50%;
    position: relative;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-switch:hover .switch-thumb {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.dark-mode .theme-switch {
    background-color: var(--card-background);
    border-color: var(--card-border);
}

.dark-mode .switch-thumb {
    transform: translateX(30px);
    background-color: var(--text-color);
}

.profile-header, section {
    background: var(--card-background);
    border: 2px solid var(--card-border);
    border-radius: 40px;
    box-shadow: 0 18px 32px 0 var(--box-shadow-color);
    margin-bottom: 24px;
    padding: 32px; 
    box-sizing: border-box; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-header:hover, section:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 40px 0 var(--box-shadow-hover-color);
}

.profile-header {
    max-width: 900px; 
    margin: 32px auto; 
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-picture-container {
    position: relative;
    display: inline-block;
}

.profile-picture {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.profile-picture-container .hat {
    position: absolute;
    top: -45px; 
    left: -10px; 
    width: 120px; 
    transform: rotate(-15deg); 
    z-index: 10;
    display: none;
}

.profile-info h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin: 0;
    text-shadow: none;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--subtitle-color);
    margin: 4px 0 24px 0;
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

section {
    max-width: 900px;
    margin: 0 auto 24px auto;
}

.profile-header.section {
    margin-top: 32px;
}

section h2 {
    font-size: 1.6rem;
    margin-top: 0;
    border-bottom: 2px solid rgba(147, 112, 219, 0.5);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.gallery-item h3 i {
    margin-right: 10px;
}

.gallery-item ul {
    padding: 0;
}

.gallery-item li {
    list-style: none;
    margin-bottom: 10px;
}

.gallery-item li img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 5px;
}

.gallery-item img {
    max-width: 100%;
    height: auto;
    border-radius: 0;
}

.social-icons {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.social-icons a {
    background: var(--link-background);
    border: 2px solid var(--card-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 var(--social-icon-box-shadow-color);
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.5rem;
    padding: 10px;
    display: inline-block;
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    transition: transform 0.2s ease;
}

.social-icons a:hover {
    transform: translateY(-3px);
    background-color: var(--link-hover-background);
}

.button-list a {
    background-color: var(--link-background);
    border: 2px solid var(--card-border);
    border-radius: 20px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.button-list a:hover {
    background-color: var(--link-hover-background);
    transform: translateY(-2px);
}

body:not(.no-transition) {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-switch:not(.no-transition) {
    transition: background-color 0.3s ease;
}

.switch-thumb:not(.no-transition) {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.profile-header:not(.no-transition), section:not(.no-transition) {
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.social-icons a:not(.no-transition) {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.button-list a:not(.no-transition) {
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.error-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff4444;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    font-size: 1rem;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
}

.flying-flag {
    position: fixed;
    top: 100%;
    font-size: 2rem;
    animation: flyUp 10s linear infinite;
    z-index: 1000;
    pointer-events: none;
}

@keyframes flyUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-120vh) rotate(360deg);
        opacity: 0;
    }
}