:root {
    --primary: #8cd7ff;
    --secondary: #e6f3ff;
    --light-text: #fff;
    --dark-text: #2c3e50;
    --card-bg: rgba(255, 255, 255, 0.95);

    --gradient-bg: linear-gradient(135deg, #8cd7ff 0%, #e6f3ff 100%);

    --shadow: 0 10px 30px rgba(140, 215, 255, 0.3);
    --hover-shadow: 0 15px 40px rgba(140, 215, 255, 0.4);

    --tag-bg: #fff;
    --tag-border: #bce6ff;
    --tag-hover: #e6f3ff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background: var(--gradient-bg);
    min-height: 100vh;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(140, 215, 255, 0.2);
    transition: transform 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease;
}

header.hidden {
    transform: translateY(-120%);
}

.lang-btn {
    position: absolute;
    right: 2rem;
}

.intro-section {
    text-align: center;
    padding-top: 8rem;
    padding-bottom: 2rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.intro-section h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    background: #0074cc;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(140, 215, 255, 0.3);
    font-weight: 700;
}

.intro-section h1 span {
    -webkit-text-fill-color: var(--dark-text);
}

.intro-section p {
    font-size: 1.3rem;
    color: var(--dark-text);
    opacity: 0.8;
    font-weight: 500;
}

.controls-section {
    max-width: 900px;
    margin: 0 auto 4rem;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    text-align: center;
    margin-left: 1rem;
    margin-right: 1rem;
}

@media (min-width: 932px) {
    .controls-section {
        margin-left: auto;
        margin-right: auto;
    }
}

.search-wrapper {
    margin-bottom: 2rem;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: 2px solid var(--secondary);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
    color: var(--dark-text);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(140, 215, 255, 0.4);
}

.filters-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.filter-label {
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-right: 10px;
    letter-spacing: 1px;
}

.tag {
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    color: var(--dark-text);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.tag:hover {
    background: var(--tag-hover);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.tag.active {
    background: var(--primary);
    color: var(--light-text);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(140, 215, 255, 0.4);
}

.reset-btn {
    margin-top: 2rem;
    background: transparent;
    border: none;
    color: var(--dark-text);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.7;
}

.reset-btn:hover { opacity: 1; color: var(--primary-dark); }

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    padding: 0 2rem 4rem 2rem;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    color: var(--light-text);
    font-weight: 600;
}

.project-card {
    background: var(--light-text);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary);
}

.card-thumb-box {
    height: 200px;
    overflow: hidden;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .card-thumb-box img { transform: scale(1.08); }

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 1.5rem;
    color: var(--dark-text);
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.card-content p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-tags .tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: var(--secondary);
    border: none;
    cursor: default;
}

.card-tags .tag:hover { transform: none; background: var(--secondary); }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

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

.modal-box {
    background: #fff;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-overlay.active .modal-box { transform: scale(1) translateY(0); }

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: var(--dark-text);
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    transition: 0.3s;
}

.close-modal:hover { color: var(--primary); transform: rotate(90deg); }

.modal-scroll { overflow-y: auto; height: 100%; }

.modal-header-section {
    background: linear-gradient(to right, #f8fbff, #eef6ff);
    padding: 3rem;
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    border-bottom: 1px solid #eee;
}

.modal-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    background: #fff;
    padding: 10px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.modal-header-info h2 {
    font-size: 2.2rem;
    color: var(--dark-text);
    margin-bottom: 1rem;
    text-align: left;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.modal-actions { display: flex; gap: 1rem; }

.btn-modal {
    text-decoration: none;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-github { background: #24292e; color: #fff; }
.btn-github:hover { background: #000; transform: translateY(-2px); }

.btn-web { background: var(--primary); color: #fff; }
.btn-web:hover { background: var(--primary-dark); transform: translateY(-2px); }

.modal-body-section {
    padding: 3rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark-text);
    text-align: justify;
}

.modal-gallery-section { padding: 0 3rem 3rem; }

.gallery-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: block;
    color: var(--primary);
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.screenshots-grid img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.screenshots-grid img:hover { transform: scale(1.02); }

@media (max-width: 1024px) {
    .intro-section h1 {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.5rem 0;
    }

    .intro-section {
        padding-top: 8rem;
    }

    .intro-section h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .intro-section p {
        font-size: 1.1rem;
    }

    .controls-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .gallery-container {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .modal-header-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 2rem;
    }

    .modal-header-info h2 { text-align: center; }
    .modal-tags, .modal-actions { justify-content: center; }
}

@media (max-width: 480px) {
    .intro-section h1 {
        font-size: 1.8rem;
    }

    .intro-section p {
        font-size: 1rem;
    }
}