/* CSS Variables (Root) - Tema terang sebagai default */
:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6a75ff;
    --background-color: #f8f9fa;
    --card-color: #ffffff;
    --text-color: #333333;
    --text-secondary: #6c757d;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Mode gelap untuk perangkat dengan preferensi gelap */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #121212;
        --card-color: #1e1e1e;
        --text-color: #ffffff;
        --text-secondary: #b0b0b0;
        --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    body {
        background-color: var(--background-color) !important;
        color: var(--text-color) !important;
    }
    
    /* Animasi bintang putih untuk mode gelap */
    .stars {
        background-image: 
            radial-gradient(2px 2px at 20px 30px, #ffffff, transparent),
            radial-gradient(2px 2px at 40px 70px, #ffffff, transparent),
            radial-gradient(1px 1px at 90px 40px, #ffffff, transparent),
            radial-gradient(1px 1px at 130px 80px, #ffffff, transparent),
            radial-gradient(2px 2px at 160px 30px, #ffffff, transparent) !important;
    }
    
    .twinkling {
        background-image: 
            radial-gradient(1px 1px at 50px 100px, #ffffff, transparent),
            radial-gradient(1px 1px at 90px 150px, #ffffff, transparent),
            radial-gradient(1px 1px at 150px 200px, #ffffff, transparent),
            radial-gradient(1px 1px at 200px 50px, #ffffff, transparent),
            radial-gradient(1px 1px at 250px 120px, #ffffff, transparent) !important;
    }
    
    .shooting-stars::before,
    .shooting-stars::after {
        background: #ffffff !important;
        box-shadow: 
            0 0 0 4px rgba(255, 255, 255, 0.1),
            0 0 0 8px rgba(255, 255, 255, 0.1),
            0 0 20px rgba(255, 255, 255, 0.5) !important;
    }
    
    .popup-overlay {
        background-color: rgba(0, 0, 0, 0.85) !important;
    }
    
    .popup-close {
        background-color: rgba(30, 30, 30, 0.9) !important;
        color: #ffffff !important;
    }
    
    .link-item {
        background-color: var(--card-color) !important;
        color: var(--text-color) !important;
    }
    
    .profile-name,
    .profile-bio,
    .link-title,
    .link-description,
    .copyright,
    .social-link {
        color: var(--text-color) !important;
    }
    
    .link-description {
        color: var(--text-secondary) !important;
    }
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Background Animation Styles */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #000, transparent),
        radial-gradient(2px 2px at 40px 70px, #000, transparent),
        radial-gradient(1px 1px at 90px 40px, #000, transparent),
        radial-gradient(1px 1px at 130px 80px, #000, transparent),
        radial-gradient(2px 2px at 160px 30px, #000, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: starsMove 50s linear infinite;
}

.twinkling {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 50px 100px, #000, transparent),
        radial-gradient(1px 1px at 90px 150px, #000, transparent),
        radial-gradient(1px 1px at 150px 200px, #000, transparent),
        radial-gradient(1px 1px at 200px 50px, #000, transparent),
        radial-gradient(1px 1px at 250px 120px, #000, transparent);
    background-repeat: repeat;
    background-size: 300px 200px;
    animation: twinkle 4s ease-in-out infinite alternate;
}

.shooting-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.shooting-stars::before,
.shooting-stars::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 4px;
    background: #000;
    border-radius: 50%;
    box-shadow: 
        0 0 0 4px rgba(0, 0, 0, 0.1),
        0 0 0 8px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(0, 0, 0, 0.5);
    animation: shootingStar 10s linear infinite;
}

.shooting-stars::before {
    top: 20%;
    left: -100px;
    animation-delay: 0s;
}

.shooting-stars::after {
    top: 60%;
    left: -200px;
    animation-delay: 5s;
}

@keyframes starsMove {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100px);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes shootingStar {
    0% {
        transform: translateX(0) translateY(0) rotate(45deg);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: translateX(1000px) translateY(500px) rotate(45deg);
        opacity: 0;
    }
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    padding: 0 10px;
}

.profile-mini-container {
    position: relative;
    width: 40px;
    height: 40px;
}

.profile-mini {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    animation: flipRotate 3s ease-in-out infinite;
    transform-style: preserve-3d;
}

@keyframes flipRotate {
    0% {
        transform: rotateY(0deg);
    }
    10% {
        transform: rotateY(180deg);
    }
    20% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(0deg);
    }
}

.copy-link {
    color: white;
    font-size: 1.2rem;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    box-shadow: var(--shadow);
    cursor: pointer;
    position: relative;
}

.copy-link:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

.copy-link.copied {
    background-color: #28a745;
}

.copy-link.copied::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #28a745;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Profile Section */
.profile {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 20px;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    margin-bottom: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.profile-img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(74, 108, 247, 0.5);
}

.profile-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.profile-bio {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
}

/* Website Links */
.links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.link-item {
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.link-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: left 0.5s ease;
}

.link-item:hover::before {
    left: 0;
}

.link-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.link-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.link-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.link-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.link-title {
    font-weight: 600;
    font-size: 1rem;
}

.link-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.link-arrow {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

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

.popup-content {
    position: relative;
    max-width: 80%;
    max-height: 80%;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

.popup-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.popup-close:hover {
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    transform: rotate(90deg);
}

/* Footer */
.footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 20px;
    width: 100%;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.social-link {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: var(--transition);
    text-decoration: none;
}

.social-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.copyright {
    margin-top: 5px;
}

.github-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.github-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .profile-img {
        width: 100px;
        height: 100px;
    }
    
    .profile-name {
        font-size: 1.5rem;
    }
}