:root {
    --primary: #C85078;
    --secondary: #201D23;
    --background: #141216;
    --light-text: #F0EEF2;
    --dark-text: #B4AFB9;

    --bg-color: var(--background);
    --card-bg: var(--secondary);
    --text-main: var(--light-text);
    --text-secondary: var(--dark-text);
    --accent: var(--primary);

    --border: #3E3944;

    --shadow: rgba(200, 80, 120, 0.15);
    --hover-shadow: rgba(200, 80, 120, 0.25);

    --lang-bg: rgba(252, 211, 77, 0.1); --lang-text: #fcd34d; --lang-border: rgba(252, 211, 77, 0.3);
    --type-bg: rgba(74, 222, 128, 0.1); --type-text: #4ade80; --type-border: rgba(74, 222, 128, 0.3);
    --soft-bg: rgba(252, 165, 165, 0.1); --soft-text: #fca5a5; --soft-border: rgba(252, 165, 165, 0.3);

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background-color: #3E3944;
    border-radius: 10px;
    border: 2px solid var(--background);
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent);
}

::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #3E3944 var(--background);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    padding: 40px 20px;
    background-image: linear-gradient(135deg, #201D23 0%, #141216 100%);
    min-height: 100vh;
    background-attachment: fixed;
}

header {
    text-align: center;
    margin-bottom: 50px;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

header h1 span {
    color: var(--accent);
    text-shadow: 0 0 20px rgba(200, 80, 120, 0.4);
}

header p {
    color: var(--text-secondary);
    font-size: 1.15rem;
}

.controls-section {
    max-width: 800px;
    margin: 0 auto 60px;
    text-align: center;
    background: rgba(32, 29, 35, 0.7);
    backdrop-filter: blur(10px);
    padding: 35px;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.search-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto 30px;
}

.search-input {
    width: 100%;
    padding: 16px 25px;
    border-radius: 50px;
    border: 2px solid var(--border);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
    background: #1A181D;
    color: var(--text-main);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 4px 15px var(--shadow);
}

.search-input::placeholder {
    text-align: center;
    color: var(--text-secondary);
    opacity: 0.7;
}

.filters-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.filter-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 700;
    margin-right: 10px;
}

.reset-btn {
    margin-top: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    transition: 0.2s;
}

.reset-btn:hover {
    color: var(--accent);
}

.tag {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.tag.lang { background: var(--lang-bg); color: var(--lang-text); border-color: var(--lang-border); }
.tag.type { background: var(--type-bg); color: var(--type-text); border-color: var(--type-border); }
.tag.soft { background: var(--soft-bg); color: var(--soft-text); border-color: var(--soft-border); }

.tag.active {
    transform: scale(1.05);
    box-shadow: 0 4px 15px var(--shadow);
    filter: brightness(1.1);
    border: 1px solid var(--accent);
}

.tag:hover {
    transform: translateY(-2px);
}

.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 40px;
}

.project-card {
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: var(--hover-shadow);
}

.card-thumb-box {
    height: 220px;
    overflow: hidden;
    background-color: #000;
}

.card-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    opacity: 0.9;
}

.project-card:hover .card-thumb-box img {
    transform: scale(1.05);
    opacity: 1;
}

.card-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--light-text);
}

.card-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    flex-grow: 1;
    line-height: 1.6;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.card-tags .tag {
    cursor: default;
    padding: 5px 12px;
    font-size: 0.75rem;
    border-radius: 8px;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.3rem;
    color: var(--text-secondary);
    padding: 60px;
    font-weight: 500;
}


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 8, 12, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--card-bg);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.7);
    border: 1px solid var(--border);
    overflow: hidden;
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.05);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 20;
    color: var(--text-main);
    transition: 0.2s;
    border: 1px solid transparent;
}

.close-modal:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
    box-shadow: var(--shadow);
}

.modal-scroll {
    overflow-y: auto;
    padding: 0;
}

.modal-header-section {
    background: linear-gradient(to bottom, #2a262e, #201D23);
    padding: 40px 40px 20px 40px;
    display: flex;
    align-items: center;
    gap: 25px;
    border-bottom: 1px solid var(--border);
}

.modal-logo {
    width: 100px;
    height: 100px;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
    background: #1A181D;
}

.modal-header-info {
    flex: 1;
    padding-right: 30px;
}

#m-title {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.modal-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-modal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-github {
    background-color: #0d1117;
    color: #ffffff;
    border: 1px solid #30363d;
}

.btn-github:hover {
    background-color: #161b22;
    border-color: #8b949e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.btn-web {
    background-color: var(--accent);
    color: #ffffff;
    border: 1px solid var(--accent);
    box-shadow: var(--shadow);
}

.btn-web:hover {
    background-color: #d8628b;
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
    border-color: #d8628b;
}

.modal-body-section {
    padding: 30px 40px;
}

#m-desc {
    white-space: pre-line;
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
    text-align: justify;
}

.modal-gallery-section {
    padding: 0 40px 40px 40px;
}

.gallery-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: block;
    color: var(--text-main);
    border-left: 4px solid var(--accent);
    padding-left: 10px;
}

.screenshots-grid {
    display: grid;
    gap: 20px;
}

.screenshots-grid img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.3s;
    background-color: #141216;
}

.screenshots-grid img:hover {
    transform: scale(1.02);
    border-color: var(--accent);
}

@media (max-width: 600px) {
    .modal-header-section {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }

    .modal-tags {
        justify-content: center;
    }

    .modal-actions {
        justify-content: center;
        width: 100%;
    }

    .btn-modal {
        flex: 1;
        justify-content: center;
    }

    .modal-body-section,
    .modal-gallery-section {
        padding: 20px;
    }
}