/* ===== CSS Variables (Color Palette) ===== */
:root {
    /* Primary Colors */
    --primary: #4FB6B8;
    --primary-dark: #3A9799;
    --primary-light: #7FCFD0;
    
    /* Background Colors */
    --background: #F6F8F7;
    --surface-container: #E9F1F0;
    --surface-container-high: #DCE8E6;
    
    /* Text Colors */
    --text-primary: #3D4A4F;
    --text-secondary: #7A8B91;
    
    /* Semantic Colors */
    --success: #5BB5A0;
    --error: #E07A7A;
    --error-dark: #CA6060;
    --warning: #F2C48D;
    --warning-dark: #E0A860;
    --info: #7FB7D6;
    
    /* UI Elements */
    --outline: #CDD9D7;
    --selected-card: #D4EFEF;
    --switch-track: #BECECC;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== Decorative Elements ===== */
.decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.flower, .owl, .heart, .leaf {
    position: absolute;
    opacity: 0.7;
}

.flower-1 {
    width: 80px;
    top: 5%;
    left: 5%;
    animation: float 6s ease-in-out infinite;
}

.flower-2 {
    width: 60px;
    top: 15%;
    right: 8%;
    animation: float 7s ease-in-out infinite 1s;
}

.flower-3 {
    width: 50px;
    bottom: 20%;
    left: 8%;
    animation: float 5s ease-in-out infinite 0.5s;
}

.owl-1 {
    width: 100px;
    bottom: 5%;
    right: 5%;
    animation: owlBob 4s ease-in-out infinite;
}

.heart-1 {
    width: 30px;
    top: 30%;
    left: 3%;
    animation: heartbeat 2s ease-in-out infinite;
}

.heart-2 {
    width: 25px;
    top: 50%;
    right: 5%;
    animation: heartbeat 2s ease-in-out infinite 0.5s;
}

.heart-3 {
    width: 35px;
    bottom: 35%;
    right: 10%;
    animation: heartbeat 2s ease-in-out infinite 1s;
}

.leaf-1 {
    width: 35px;
    top: 40%;
    left: 2%;
    animation: sway 4s ease-in-out infinite;
    transform-origin: bottom center;
}

.leaf-2 {
    width: 30px;
    top: 60%;
    right: 3%;
    animation: sway 4s ease-in-out infinite 1s;
    transform-origin: bottom center;
}

/* ===== Animations ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

@keyframes owlBob {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes sway {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

/* ===== Main Container ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 420px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== Profile Section ===== */
.profile {
    text-align: center;
    margin-bottom: 32px;
}

.profile-image-wrapper {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto 20px;
}

.profile-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-container);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid white;
    box-shadow: 0 4px 20px rgba(79, 182, 184, 0.2);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-icon {
    font-size: 50px;
}

.profile-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px dashed var(--primary);
    animation: spin 20s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.profile-name {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.profile-bio {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-bio::before,
.profile-bio::after {
    content: '✿';
    color: var(--error);
    opacity: 0.6;
    font-size: 0.9rem;
}

/* ===== Links Section ===== */
.links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.link-card {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    border: 2px solid transparent;
    box-shadow: 0 2px 12px rgba(79, 182, 184, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.link-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(79, 182, 184, 0.2);
}

.link-card:hover::before {
    left: 100%;
}

.link-card:active {
    transform: translateY(-1px);
    background: var(--selected-card);
}

.link-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-container);
    border-radius: 12px;
    margin-right: 14px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.link-icon svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
    transition: all 0.3s ease;
}

.link-card:hover .link-icon {
    background: var(--primary);
}

.link-card:hover .link-icon svg {
    color: white;
}

.link-text {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.link-arrow {
    color: var(--text-secondary);
    font-size: 1.2rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.link-card:hover .link-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ===== Footer ===== */
.footer {
    margin-top: auto;
    padding-top: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-hearts {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.footer-hearts span {
    animation: heartbeat 2s ease-in-out infinite;
}

.footer-hearts span:nth-child(1) {
    color: var(--error);
    animation-delay: 0s;
}

.footer-hearts span:nth-child(2) {
    color: var(--primary);
    animation-delay: 0.3s;
}

.footer-hearts span:nth-child(3) {
    color: var(--warning);
    animation-delay: 0.6s;
}

.footer .copyright {
    font-size: 0.75rem;
    margin-top: 12px;
    opacity: 0.7;
}

/* ===== Language Selector ===== */
.lang-selector {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid var(--outline);
    border-radius: 25px;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.lang-toggle:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(79, 182, 184, 0.15);
}

.lang-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.lang-selector.open .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 2px solid var(--outline);
    border-radius: 16px;
    padding: 8px;
    min-width: 180px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.lang-selector.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    border-radius: 10px;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background: var(--surface-container);
    color: var(--primary-dark);
}

/* Custom scrollbar for dropdown */
.lang-dropdown::-webkit-scrollbar {
    width: 6px;
}

.lang-dropdown::-webkit-scrollbar-track {
    background: var(--surface-container);
    border-radius: 3px;
}

.lang-dropdown::-webkit-scrollbar-thumb {
    background: var(--outline);
    border-radius: 3px;
}

.lang-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== RTL Support ===== */
[dir="rtl"] .lang-selector {
    right: auto;
    left: 16px;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .link-card {
    flex-direction: row-reverse;
}

[dir="rtl"] .link-icon {
    margin-right: 0;
    margin-left: 14px;
}

[dir="rtl"] .link-arrow {
    transform: scaleX(-1);
}

[dir="rtl"] .link-card:hover .link-arrow {
    transform: scaleX(-1) translateX(0);
}

[dir="rtl"] .profile-bio::before,
[dir="rtl"] .profile-bio::after {
    content: '✿';
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 480px) {
    .container {
        padding: 30px 16px;
    }
    
    .profile-name {
        font-size: 1.75rem;
    }
    
    .owl-1 {
        width: 70px;
    }
    
    .flower-1, .flower-2 {
        width: 50px;
    }
}

@media (min-width: 768px) {
    .decorations {
        opacity: 0.8;
    }
    
    .owl-1 {
        width: 120px;
        right: 10%;
    }
    
    .flower-1 {
        width: 100px;
    }
    
    .flower-2 {
        width: 80px;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    .flower, .owl, .heart, .leaf, .profile-ring, .footer-hearts span {
        animation: none;
    }
    
    .link-card::before {
        display: none;
    }
}

/* Focus states for keyboard navigation */
.link-card:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 182, 184, 0.3);
}

.link-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
