/* ======================== */
/* 1. Global & Base Styles */
/* ======================== */

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    color: #333;
    margin: 0;
    
    /* Animated gradient background */
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    background-size: 400% 400%;
    animation: gradient-animation 15s ease infinite;
    overflow-x: hidden;
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
    border: 3px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ======================== */
/* 2. Profile Card & Header */
/* ======================== */

/* Subtle floating effect for the profile card */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0px);
    }
}

.profile-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 40px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: float 6s ease-in-out infinite;
    position: relative;
    box-sizing: border-box;
}

/* Adjust card width for sub-pages */
body:not(:has(.links-container)) .profile-card {
    max-width: 600px;
}

body:has(#projects-container) .profile-card {
    max-width: 800px;
}

body:has(#bots-container) .profile-card {
    max-width: 700px;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    animation-play-state: paused;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.avatar:hover {
    transform: scale(1.05) rotate(5deg);
}

.name {
    margin: 20px 0 5px;
    font-size: 2.5rem;
    font-weight: 600;
    color: #4a4a4a;
}

.bio {
    margin: 0 0 20px;
    color: #666;
    font-size: 1rem;
}

/* ======================== */
/* 3. Links & Back Button  */
/* ======================== */

.links-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
    transition: all 0.5s ease;
}

.link-button {
    text-decoration: none;
    background-color: #4a90e2;
    color: #fff;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.link-button:hover {
    background-color: #3b74b8;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
}

/* Space between icon and text */
.link-button i {
    margin-right: 8px;
}

/* Animation for the buttons as they appear */
.hidden-button {
    animation: fadeInSlideUp 0.5s forwards;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.back-button {
    text-decoration: none;
    background-color: #f0f2f5;
    color: #555;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    position: absolute;
    top: 20px;
    left: 20px;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.back-button:hover {
    background-color: #e0e2e5;
}

/* ======================== */
/* 4. Blog Post Styles     */
/* ======================== */

.blog-posts-container {
    margin-top: 20px;
    text-align: left;
    width: 100%;
}

.blog-post {
    background-color: #fff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.blog-post:hover {
    transform: translateY(-5px);
}

.post-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-top: 0;
}

.post-date {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.post-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
}

/* ======================== */
/* 5. Project Card Styles  */
/* ======================== */

#projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
    width: 100%;
}

.project-card {
    background-color: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.project-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 10px;
}

.project-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.project-tech {
    font-size: 0.85rem;
    font-weight: 500;
    color: #4a90e2;
    margin-bottom: 15px;
}

.project-link {
    display: inline-block;
    background-color: #4a90e2;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.project-link:hover {
    background-color: #3b74b8;
}

/* ============================ */
/* 6. Discord Bot Card Styles  */
/* ============================ */

#bots-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 30px;
    width: 100%;
}

.bot-card {
    background-color: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.bot-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.bot-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #7289DA;
    flex-shrink: 0;
}

.bot-details {
    flex-grow: 1;
}

.bot-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 5px;
    color: #333;
}

.bot-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.bot-status {
    font-size: 0.9rem;
    font-weight: 500;
}

.bot-status .online {
    color: #2ecc71;
    font-weight: bold;
}

.bot-status .offline {
    color: #e74c3c;
    font-weight: bold;
}

.bot-links-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.bot-link {
    display: inline-block;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.bot-link .fa-brands, .bot-link .fa-solid {
    margin-right: 8px;
}

/* Primary "Invite" Button */
.invite-button {
    background-color: #7289DA;
}

.invite-button:hover {
    background-color: #5b6eae;
}

/* Secondary "Website" Button */
.website-button {
    background-color: transparent;
    border: 2px solid #ddd;
    color: #555;
    box-shadow: none;
}

.website-button:hover {
    background-color: #f0f2f5;
    border-color: #c2c2c2;
    color: #333;
}

/* ======================== */
/* 7. API Key Styles      */
/* ======================== */

#api-keys-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
    width: 100%;
}

.api-key-card {
    background-color: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.api-key-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.key-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 5px;
    color: #333;
}

.key-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Style cho trường hợp dùng Emoji thay ảnh */
.bot-avatar-emoji {
    width: 60px;   /* Bằng kích thước .bot-avatar của bạn */
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px; /* Độ lớn của emoji */
    flex-shrink: 0;
}

.key-container {
    background-color: #f0f2f5;
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
}

.key-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-button {
    background-color: #4a90e2;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.copy-button:hover {
    background-color: #3b74b8;
}

.copy-button:disabled {
    background-color: #2ecc71;
    cursor: not-allowed;
}

.copy-button .fa-solid {
    margin-right: 5px;
}

/* ============================ */
/* 8. Media Queries for Mobile */
/* ============================ */

@media (max-width: 600px) {
    .profile-card {
        padding: 30px 20px;
    }

    .name {
        font-size: 2rem;
    }

    .link-button {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .api-key-card {
        padding: 20px;
    }

    .key-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .copy-button {
        width: 100%;
        margin-top: 10px;
    }
}

/* ======================== */
/* 9. Loading Screen */
/* ======================== */

.hidden {
    display: none;
}

.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    z-index: 9999;
    transition: opacity 0.5s ease-in-out;
}

.loader {
    width: 50px;
    aspect-ratio: 1;
    display: grid;
    border-radius: 50%;
    background:
        linear-gradient(0deg ,rgb(0 0 0/50%) 30%,#0000 0 70%,rgb(0 0 0/100%) 0) 50%/8% 100%,
        linear-gradient(90deg,rgb(0 0 0/25%) 30%,#0000 0 70%,rgb(0 0 0/75% ) 0) 50%/100% 8%;
    background-repeat: no-repeat;
    animation: l23 1s infinite steps(12);
}
.loader::before,
.loader::after {
    content: "";
    grid-area: 1/1;
    border-radius: 50%;
    background: inherit;
    opacity: 0.915;
    transform: rotate(30deg);
}
.loader::after {
    opacity: 0.83;
    transform: rotate(60deg);
}
@keyframes l23 {
    100% {transform: rotate(1turn)}
}

/* ======================== */
/* Footer Copyright Style   */
/* ======================== */

.copyright {
    margin-top: 30px;         /* Tạo khoảng cách với danh sách bên trên */
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Đường kẻ ngang mờ nhẹ */
    text-align: center;
}

.copyright p {
    font-size: 0.8rem;        /* Chữ nhỏ gọn */
    color: rgba(255, 255, 255, 0.5); /* Màu chữ mờ để không làm xao nhãng */
    letter-spacing: 0.5px;
    margin: 0;
    font-weight: 400;
}

/* Hiệu ứng khi di chuột qua phần bản quyền */
.copyright:hover p {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

/* Đảm bảo Copyright vẫn đẹp trên điện thoại */
@media (max-width: 480px) {
    .copyright {
        margin-top: 20px;
        padding-top: 15px;
    }
}

/* Style dành riêng để hiển thị Emoji thay cho ảnh avatar */
.bot-avatar.emoji-display {
    display: flex !important;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1); /* Nền mờ cho emoji */
    font-size: 32px; /* Chỉnh kích thước emoji to nhỏ ở đây */
    line-height: 1;
    overflow: hidden;
}

/* Khung chứa Emoji khi không có ảnh */
.emoji-placeholder {
    width: 60px;
    height: 60px;
    min-width: 60px; /* Đảm bảo không bị bóp méo */
    background: rgba(255, 255, 255, 0.1); /* Nền mờ Glassmorphism */
    border-radius: 12px;
    display: flex !important;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    margin-right: 15px; /* Khoảng cách với phần chữ bên phải */
    border: 1px solid rgba(255, 255, 255, 0.1);
}