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

:root {
    --bg-color: #0f1419;
    --text-color: #ffffff;
    --card-bg: #1a2332;
    --card-hover: #222d3d;
    --accent: #3b9cff;
    --tag-mod: #ff0000;
    --tag-datapack: #1bd96a;
    --tag-modpack: #c026d3;
    --tag-server: #5865f2;
}

[data-theme="light"] {
    --bg-color: #f5f5f5;
    --text-color: #1a1a1a;
    --card-bg: #ffffff;
    --card-hover: #f0f0f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 80px 20px 40px;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

#themeBtn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

#themeBtn:hover {
    transform: scale(1.1);
}

.sun-icon {
    display: none;
}

[data-theme="light"] .sun-icon {
    display: inline;
}

[data-theme="light"] .moon-icon {
    display: none;
}

.lang-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
}

#langBtn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

#langBtn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.back-btn {
    position: fixed;
    top: 20px;
    left: 90px;
    z-index: 100;
}

.back-btn a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transition: all 0.3s ease;
}

[data-theme="light"] .back-btn a {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.back-btn a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-4px);
}

[data-theme="light"] .back-btn a:hover {
    background: rgba(0, 0, 0, 0.08);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

[data-theme="light"] .tab-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

[data-theme="light"] .tab-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.2);
}

.tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    position: relative;
}

.project-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

.project-card.slide-out {
    animation: slideOut 0.3s ease-out forwards;
}

.projects-grid.transitioning {
    pointer-events: none;
}

[data-theme="light"] .project-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .project-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.project-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(59, 156, 255, 0.1), rgba(27, 217, 106, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    padding: 25px;
}

[data-theme="light"] .project-image {
    background: linear-gradient(135deg, rgba(59, 156, 255, 0.05), rgba(27, 217, 106, 0.05));
}

.project-image img {
    width: 190px !important;
    height: 190px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain;
    border-radius: 8px;
}

.project-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

.project-description {
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.85;
    margin-bottom: 14px;
    flex: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.tag.mod {
    background-color: var(--tag-mod);
}

.tag.datapack {
    background-color: var(--tag-datapack);
}

.tag.modpack {
    background-color: var(--tag-modpack);
}

.tag.server {
    background-color: var(--tag-server);
}

.project-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-date {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.5;
    text-align: center;
}

[data-theme="light"] .project-date {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.project-link {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 10px 16px;
    border-radius: 8px;
    text-align: center;
}

.project-link:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.project-link:not(.source-link) {
    background-color: #1bd96a;
    color: white;
}

.wiki-link {
    background-color: #e74c3c !important;
    color: white !important;
}

.youtube-link {
    background-color: #ff0000 !important;
    color: white !important;
}

.description-btn {
    background-color: #9b59b6 !important;
    color: white !important;
    border: none;
    cursor: pointer;
}

.description-btn:hover {
    opacity: 0.9;
}

.source-link {
    color: var(--accent);
    background: transparent;
    padding: 8px 0;
}
    opacity: 0.8;

.source-link {
    color: #125dce;
}

@media (max-width: 768px) {
    .page-title {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    body {
        padding: 100px 15px 30px;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .modal-content {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    opacity: 0.6;
}

.modal-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-right: 40px;
    color: var(--accent);
}

.modal-description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.modal-description p {
    margin-bottom: 16px;
    word-wrap: break-word;
}

.modal-description h3 {
    font-size: 20px;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--accent);
    word-wrap: break-word;
}

.modal-description ul, .modal-description ol {
    margin-left: 24px;
    margin-bottom: 16px;
    margin-top: 8px;
}

.modal-description li {
    margin-bottom: 6px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 90vh;
    }
    
    .modal-title {
        font-size: 22px;
    }
    
    .modal-description {
        font-size: 14px;
    }
}
