/* projects.css — extends style.css for the projects page */

/* ── LAYOUT ── */
.projects-container {
    max-width: 960px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #fff;
}

.back-link i {
    font-size: 16px;
}

/* ── CONTROLS ── */
.projects-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.projects-search-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.projects-search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0.45;
    pointer-events: none;
}

#projects-search {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    padding: 10px 14px 10px 38px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

#projects-search:focus {
    border-color: rgba(124, 58, 237, 0.8);
    background: rgba(255, 255, 255, 0.12);
}

#projects-search::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* ── FILTER BUTTONS ── */
.projects-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.65);
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.filter-btn.active {
    background: rgba(124, 58, 237, 0.35);
    border-color: rgba(124, 58, 237, 0.75);
    color: #fff;
}

/* ── COUNT ── */
.projects-count {
    font-size: 13px;
    opacity: 0.5;
    margin-bottom: 18px;
}

/* ── GRID ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

/* ── CARD ── */
.project-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    position: relative;
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease both;
}

.project-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(124, 58, 237, 0.55);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(124, 58, 237, 0.15);
}

/* ── THUMBNAIL ── */
.project-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

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

/* Auto-generated thumbnail */
.thumb-auto {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
}

.thumb-auto-grid {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(255, 255, 255, 0.04) 19px, rgba(255, 255, 255, 0.04) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(255, 255, 255, 0.04) 19px, rgba(255, 255, 255, 0.04) 20px);
}

.thumb-auto-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.07) 0%, transparent 65%);
}

.thumb-auto-name {
    position: relative;
    z-index: 1;
    font-size: clamp(0.9rem, 3vw, 1.35rem);
    font-weight: 700;
    text-align: center;
    line-height: 1.25;
    word-break: break-word;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

.thumb-auto-lang {
    position: absolute;
    bottom: 8px;
    right: 10px;
    z-index: 1;
    font-size: 11px;
    opacity: 0.45;
    letter-spacing: 0.06em;
}

/* ── CARD BODY ── */
.project-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.project-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-desc {
    font-size: 13px;
    opacity: 0.65;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    padding-top: 10px;
    flex-wrap: wrap;
}

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
}

.badge-github {
    background: rgba(88, 214, 141, 0.12);
    color: #58d68d;
    border: 1px solid rgba(88, 214, 141, 0.28);
}

.badge-custom {
    background: rgba(243, 156, 18, 0.12);
    color: #f0a500;
    border: 1px solid rgba(243, 156, 18, 0.28);
}

.badge-lang {
    background: rgba(124, 58, 237, 0.18);
    color: rgba(200, 175, 255, 0.9);
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.project-stars {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.55;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ── SKELETON ── */
.project-skeleton {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 16px;
    overflow: hidden;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skel-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(255, 255, 255, 0.05);
}

.skel-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skel-line {
    height: 12px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 6px;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.45; }
    50%       { opacity: 1; }
}

/* ── EMPTY STATE ── */
.projects-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    opacity: 0.45;
    font-size: 15px;
}

.projects-empty i {
    font-size: 34px;
    display: block;
    margin-bottom: 12px;
}

/* ── TOAST ── */
.projects-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(70px);
    background: rgba(26, 15, 46, 0.96);
    border: 1px solid rgba(124, 58, 237, 0.5);
    border-radius: 12px;
    padding: 12px 22px;
    font-size: 14px;
    color: #fff;
    z-index: 300;
    transition: transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.projects-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .projects-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .projects-filters {
        flex-wrap: wrap;
    }
}
