* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    background-color: #1e1e1e;
}

main {
    display: flex;
    flex-direction: column;
    width: 100%;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: #eee;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    background: #2c2c2c;
    padding: 15px 30px;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar::before {
    content: '';
    flex: 1;
}

.navbar ul {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    gap: 25px;
    flex: 1;
}

.navbar a {
    text-decoration: none;
    color: #9a88ff;
    font-weight: 600;
}

.lang-switcher {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-left: 15px;
    flex: 1;
}

.lang-btn {
    background: none;
    border: 2px solid transparent;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.lang-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.lang-btn:hover {
    transform: scale(1.1);
}

.lang-btn.active {
    border-color: #9a88ff;
}

@media (max-width: 768px) {
    .navbar { 
        padding: 10px 15px; 
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 10px;
    }
    .navbar::before {
        display: none;
    }
    .navbar ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px 15px;
        flex: 1;
    }
    .navbar a { font-size: 13px; }
    .lang-switcher {
        border-left: none;
        padding-left: 0;
        flex: none;
        justify-content: flex-end;
    }
    .lang-btn {
        width: 24px;
        height: 24px;
    }
}

header, section {
    width: 100%;
    padding: 40px 20px;
    display: block;
    position: relative;
    overflow: hidden;
}

.hero, .about, .collab { background-color: #2c2c2c; }
.projects, .contact { background-color: #1e1e1e; }

.highlight { color: #9a88ff; font-weight: 600; }

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #7b63e3;
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: 0.3s;
}
.btn:hover { background-color: #9a88ff; }

.hero { text-align: center; padding-bottom: 20px; }

.hero-img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid #9a88ff;
    margin-bottom: 20px;
    object-fit: cover;
}

.hero h1 {
    font-size: 2.5rem;
    color: #9a88ff;
    margin-bottom: 10px;
}

.hero p {
    margin-bottom: 30px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.about { text-align: center; padding-top: 0; }
.about p {
    max-width: 800px;
    margin: 0 auto 15px auto;
    text-align: justify;
}

.projects { padding-top: 40px; }
.projects h2 {
    text-align: center;
    color: #9a88ff;
    margin-bottom: 40px;
}

.project-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.project-card {
    background-color: #2c2c2c;
    padding: 25px 20px;
    border-radius: 15px;
    width: 260px;
    cursor: pointer;
    transition: transform 0.3s ease;
    text-align: center;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(154, 136, 255, 0.2);
}

.project-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 15px;
    object-fit: cover;
}

.small-text a { color: #9a88ff !important; }

.collab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.collab h2 {
    text-align: center;
    color: #9a88ff;
    margin-bottom: 40px;
    font-size: 2.5rem;
}

.collab-grid {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.collab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 320px;
    max-width: 550px;
    background: #252525;
    padding: 40px 30px;
    border-radius: 25px;
    text-align: center;
    border: 1px solid #333;
    transition: all 0.3s ease;
}

.collab-item:hover {
    transform: translateY(-10px);
    border-color: #9a88ff;
    box-shadow: 0 15px 40px rgba(154, 136, 255, 0.2);
}

.collab-img img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 25px;
    border: 3px solid #9a88ff;
    transition: transform 0.3s ease;
}

.collab-info h3 {
    color: #9a88ff;
    margin-bottom: 20px;
    font-size: 1.6rem;
}

.collab-info p {
    font-size: 15px;
    margin-bottom: 15px;
    text-align: left;
}

.collab-info .small-text {
    margin-top: 20px;
    font-size: 13px;
    text-align: center;
    color: #888;
}

.collab-link { margin-top: auto; padding-top: 20px; }
.collab-link a {
    color: #9a88ff;
    text-decoration: none;
    font-weight: bold;
}

@media (max-width: 768px) {
    .collab-grid { gap: 20px; }
    .collab h2 { font-size: 2rem; }
    .collab-item { max-width: 100%; padding: 30px 20px; }
    .collab-img img { width: 140px; height: 140px; }
}

.contact { text-align: center; padding: 40px 20px; }
.contact h2 { color: #9a88ff; margin-bottom: 20px; }
.contact p { margin-bottom: 25px; }
.contact ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.contact a, .contact span { color: #9a88ff; text-decoration: none; font-weight: 600; cursor: pointer; }

footer {
    background-color: #1a1a1a;
    padding: 15px 20px;
    text-align: center;
    color: #555;
    border-top: 1px solid #333;
}
footer .small-text { font-size: 10px; }

.project-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: #2c2c2c;
    padding: 30px;
    border-radius: 20px;
    max-width: 900px;
    width: 95%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-body { display: flex; gap: 30px; align-items: center; text-align: left; }
.modal-img img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; }
#modal-1 .modal-img img { border: 2px solid #9a88ff; }

.modal-text { display: flex; flex-direction: column; justify-content: center; flex: 1; }
.modal-text h2 { color: #9a88ff; font-size: 1.8rem; text-align: left; margin-bottom: 10px; }

.logo-author { font-size: 11px; margin-top: 10px; color: #888; }
.info-text { font-size: 10px; color: #888; margin-top: 5px; font-style: italic; }

.close { position: absolute; top: 10px; right: 20px; font-size: 30px; cursor: pointer; color: #fff; }

@media (max-width: 800px) {
    .modal-body { flex-direction: column; text-align: center; }
    .modal-text h2 { text-align: center; margin-top: 20px; }
}

#dark-mode-toggle, #bmc-floating-button {
    position: fixed;
    bottom: 30px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

#dark-mode-toggle { right: 30px; background: #7b63e3; border: none; color: white; font-size: 20px; }
#bmc-floating-button { right: 95px; background: #FFDD00; text-decoration: none; }
#bmc-floating-button img { width: 25px; height: 25px; }

#dark-mode-toggle:hover, #bmc-floating-button:hover { transform: scale(1.1); }

.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #7b63e3;
    padding: 12px 25px;
    border-radius: 10px;
    opacity: 0;
    transition: 0.3s;
    z-index: 3000;
    color: white;
}
.toast.show { opacity: 1; }

body.light { background-color: #f4f4f4; color: #222; }
body.light .navbar, body.light .hero, body.light .about, body.light .collab, body.light .project-card, body.light .modal-content, body.light .collab-item {
    background-color: #fff;
    color: #222;
}
body.light .projects, body.light .contact { background-color: #f4f4f4; }
body.light .navbar a, body.light h2, body.light .contact a, body.light .collab-info h3, body.light .collab-link a { color: #7b63e3; }
body.light .collab-item { border-color: #ddd; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
body.light footer { background-color: #eee; color: #333; border-top: 1px solid #ddd; }
body.light #bmc-floating-button { box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
body.light .info-text { color: #666; }

@media (max-width: 768px) {
    #dark-mode-toggle { bottom: 20px; right: 20px; width: 50px; height: 50px; }
    #bmc-floating-button { bottom: 20px; right: 80px; width: 50px; height: 50px; }
}