:root {
    --bg-color: #1a1a2e;
    --primary-color: #00e5ff;
    --secondary-color: #e4007c;
    --text-color: #f0f0f0;
    --center-node-size: 120px;
    --friend-node-size: 80px;
    --orbit-radius: 250px;
    --animation-duration: 25s;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

@keyframes move-stars {
    from { transform: translateY(0px); }
    to { transform: translateY(-2000px); }
}

#stars1, #stars2, #stars3 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
}

#stars1 {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="2000" height="2000"><circle cx="100" cy="100" r="1.2" fill="white"/><circle cx="500" cy="300" r="1.5" fill="white"/><circle cx="900" cy="200" r="0.8" fill="white"/><circle cx="1300" cy="400" r="1" fill="white"/><circle cx="1700" cy="250" r="1.1" fill="white"/></svg>') 0 0 repeat;
    background-size: 2000px 2000px;
    animation: move-stars 150s linear infinite;
}
#stars2 {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="2000" height="2000"><circle cx="200" cy="600" r="0.8" fill="white"/><circle cx="700" cy="800" r="1.1" fill="white"/><circle cx="1100" cy="900" r="0.7" fill="white"/><circle cx="1500" cy="700" r="0.9" fill="white"/></svg>') 0 0 repeat;
    background-size: 2000px 2000px;
    animation: move-stars 100s linear infinite;
}
#stars3 {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="2000" height="2000"><circle cx="400" cy="1100" r="0.7" fill="white"/><circle cx="800" cy="1400" r="1" fill="white"/><circle cx="1200" cy="1200" r="0.6" fill="white"/><circle cx="1600" cy="1500" r="0.8" fill="white"/></svg>') 0 0 repeat;
    background-size: 2000px 2000px;
    animation: move-stars 50s linear infinite;
}

.cof-container {
    position: relative;
    width: calc(var(--orbit-radius) * 2 + var(--friend-node-size));
    height: calc(var(--orbit-radius) * 2 + var(--friend-node-size));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.center-node {
    width: var(--center-node-size);
    height: var(--center-node-size);
    background: radial-gradient(circle, var(--primary-color), #162447);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 1.5rem;
    position: relative;
    z-index: 10;
    box-shadow: 0 0 25px var(--primary-color), inset 0 0 15px rgba(255,255,255,0.3);
    border: 2px solid var(--primary-color);
    animation: pulse 4s infinite ease-in-out;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.center-node:hover {
    transform: scale(1.1);
}

.friend-path {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-origin: center;
    animation: orbit var(--animation-duration) linear infinite;
}

.cof-container:hover .friend-path {
    animation-play-state: paused;
}

.cof-container .friend-path:hover ~ .center-node {
    box-shadow: 0 0 35px var(--secondary-color);
    transform: scale(1.05);
}

.friend-node {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--friend-node-size);
    height: var(--friend-node-size);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    transform-origin: center;
    animation: node-appear 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes node-appear {
    from {
        transform: translate(-50%, -50%) translateX(50px) scale(0.2);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) translateX(var(--orbit-radius)) scale(1);
        opacity: 1;
    }
}

.friend-node:hover {
    transform: translate(-50%, -50%) translateX(var(--orbit-radius)) scale(1.2) !important;
    z-index: 20;
}

.friend-node img {
    width: 90%;
    height: 90%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--secondary-color);
    box-shadow: 0 0 15px var(--secondary-color);
}

.friend-node .friend-name {
    position: absolute;
    bottom: -25px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.friend-node:hover .friend-name {
    opacity: 1;
}

.line {
    position: absolute;
    left: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--primary-color));
    transform-origin: left;
    transform: translateY(-50%);
    animation: grow-line 0.8s ease-out forwards;
    width: 0;
    opacity: 0;
    transition: opacity 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

@keyframes grow-line {
    from { width: 0; opacity: 0; }
    to { width: var(--orbit-radius); opacity: 0.3; }
}

.friend-path:hover .line {
    opacity: 0.9;
    background: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 1000;
}

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

.modal-content {
    background: var(--bg-color);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 30px var(--primary-color);
    transform: scale(0.8);
    transition: transform 0.4s ease;
}

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

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
}

.modal-content img,
.modal-content h2,
.modal-content p,
.modal-links {
    opacity: 0;
}

@keyframes content-fade-in {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-overlay.active .modal-content img {
    animation: content-fade-in 0.5s 0.2s ease-out forwards;
}
.modal-overlay.active .modal-content h2 {
    animation: content-fade-in 0.5s 0.3s ease-out forwards;
}
.modal-overlay.active .modal-content p {
    animation: content-fade-in 0.5s 0.4s ease-out forwards;
}
.modal-overlay.active .modal-links {
    animation: content-fade-in 0.5s 0.5s ease-out forwards;
}

.modal-content img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--secondary-color);
    margin-bottom: 20px;
}

.modal-content h2 {
    margin: 0 0 10px;
    color: var(--primary-color);
}

.modal-content p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.modal-links {
    display: flex;
    justify-content: center;
    gap: 25px;
}

.modal-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

.modal-links a:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.modal-links svg {
    width: 32px;
    height: 32px;
}

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

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 25px var(--primary-color); }
    50% { transform: scale(1.05); box-shadow: 0 0 40px var(--primary-color); }
    100% { transform: scale(1); box-shadow: 0 0 25px var(--primary-color); }
}

@media (max-width: 768px) {
    :root {
        --center-node-size: 90px;
        --friend-node-size: 65px;
        --orbit-radius: 150px;
    }
    .center-node { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    :root {
        --orbit-radius: 120px;
    }
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    text-align: center;
    z-index: 100;
}

footer p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}