/**
 * portfolio-card.css — Next Horizon v3.1
 * Palette: #0a0a0f · #1B3653 · #2A7DD8 · #1F7A8C · #fff · #CECECE
 */

/* ══ GRID ════════════════════════════════════════════════════════ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 0;
    max-width: 100%;
    margin: 0 auto;
}

/* ══ CARD ════════════════════════════════════════════════════════ */
.project-card {
    background: rgba(15,15,26,.9);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(42,125,216,.18);
    transition: transform .45s cubic-bezier(.4,0,.2,1),
                box-shadow .45s cubic-bezier(.4,0,.2,1),
                border-color .3s;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    /* reveal */
    opacity: 0;
    transform: translateY(22px);
}
.project-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .5s ease, transform .5s ease,
                box-shadow .45s cubic-bezier(.4,0,.2,1),
                border-color .3s;
}
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2A7DD8, transparent);
    opacity: 0;
    transition: opacity .45s;
    z-index: 2;
    pointer-events: none;
}
.project-card:hover {
    transform: translateY(-8px) !important;
    border-color: rgba(42,125,216,.5);
    box-shadow: 0 22px 60px rgba(0,0,0,.55),
                0 0 36px rgba(42,125,216,.12);
}
.project-card:hover::before { opacity: 1; }

/* ══ VIDEO CONTAINER ══════════════════════════════════════════════ */
.project-video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;   /* 16:9 strict */
    background: #06060f;
    overflow: hidden;
    flex-shrink: 0;
}

/* Thumbnail (غلاف) */
.project-thumbnail {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .55s cubic-bezier(.4,0,.2,1);
    z-index: 1;
}
.project-card:hover .project-thumbnail { transform: scale(1.06); }

/* Video */
.project-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform .55s cubic-bezier(.4,0,.2,1);
}
.project-card:hover .project-video { transform: scale(1.06); }

/* Placeholder (لا يوجد فيديو ولا غلاف) */
.project-no-video {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
        rgba(42,125,216,.05),
        rgba(31,122,140,.03));
}
.project-no-video i {
    font-size: 3.5rem;
    opacity: .12;
    color: #1F7A8C;
}

/* ══ OVERLAY ══════════════════════════════════════════════════════ */
.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 35%,
        rgba(6,6,20,.82) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 3;
}
.project-card:hover .project-overlay { opacity: 1; }

/* ══ PLAY BUTTON ═════════════════════════════════════════════════ */
.play-btn {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(42,125,216,.88);
    border: 2px solid rgba(255,255,255,.65);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1),
                box-shadow .3s,
                background .25s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 28px rgba(42,125,216,.55);
    transform: scale(.8);
}
.project-card:hover .play-btn { transform: scale(1); }
.play-btn:hover {
    background: #2A7DD8;
    box-shadow: 0 8px 36px rgba(42,125,216,.75);
}
.play-btn i { margin-left: 3px; }

/* ══ INFO SECTION ════════════════════════════════════════════════ */
.project-info {
    padding: 18px 18px 16px;
    background: linear-gradient(to bottom,
        rgba(15,15,26,.96),
        rgba(10,10,20,1));
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ══ TITLE ════════════════════════════════════════════════════════ */
.project-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.45;
    letter-spacing: .4px;
    text-transform: uppercase;
    /* 2 أسطر ثابتة — يمنع اختلاف الارتفاع */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.45em * 2);
}

/* ══ RATING ══════════════════════════════════════════════════════ */
.project-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 22px;
}
.stars {
    display: flex;
    gap: 2px;
    color: #f59e0b;
    font-size: 13px;
    text-shadow: 0 0 8px rgba(245,158,11,.45);
}
.stars .far.fa-star { color: rgba(255,255,255,.18); text-shadow: none; }
.rating-number {
    font-size: 12px;
    font-weight: 700;
    color: #2A7DD8;
    font-family: 'Orbitron', sans-serif;
}

/* ══ COMMENT ══════════════════════════════════════════════════════ */
.project-comment {
    font-size: 11.5px;
    color: rgba(206,206,206,.5);
    line-height: 1.6;
    margin: 0 0 10px;
    padding: 9px 12px;
    background: rgba(42,125,216,.05);
    border-radius: 8px;
    border-right: 2px solid rgba(42,125,216,.3);
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ══ META ════════════════════════════════════════════════════════ */
.project-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(42,125,216,.12);
    font-size: 11.5px;
    color: rgba(206,206,206,.55);
    font-family: 'Cairo', sans-serif;
    flex: 1;
}
.project-service {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.project-views,
.project-date {
    display: flex;
    align-items: center;
    gap: 5px;
}
.project-meta i {
    color: #1F7A8C;
    font-size: 10px;
    width: 12px;
    text-align: center;
    flex-shrink: 0;
}


/* ══ DETAILS BUTTON ════════════════════════════════════════════ */
.btn-details {
    flex: 1;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all .28s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    border: 1px solid rgba(42,125,216,.35);
    background: linear-gradient(135deg, #2A7DD8, #1a5fb8);
    color: #fff;
    box-shadow: 0 4px 14px rgba(42,125,216,.3);
    position: relative;
    overflow: hidden;
}
.btn-details::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
    transition: left .5s ease;
}
.btn-details:hover::after { left: 150%; }
.btn-details:hover {
    background: linear-gradient(135deg, #3388e8, #2A7DD8);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(42,125,216,.5);
}

/* ══ ACTIONS ══════════════════════════════════════════════════════ */
.project-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.btn-pdf {
    flex: 1;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all .28s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    border: 1px solid rgba(229,85,85,.3);
    background: rgba(229,85,85,.07);
    color: rgba(229,85,85,.8);
    position: relative;
    overflow: hidden;
}
.btn-pdf::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
    transition: left .5s ease;
}
.btn-pdf:hover::after { left: 150%; }
.btn-pdf:hover {
    background: rgba(229,85,85,.82);
    color: #fff;
    border-color: #e55;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229,85,85,.32);
}
.btn-pdf.disabled {
    opacity: .32;
    cursor: not-allowed;
    pointer-events: none;
    background: rgba(255,255,255,.03);
    border-color: rgba(255,255,255,.08);
    color: rgba(206,206,206,.3);
}

/* ══ SKELETON ════════════════════════════════════════════════════ */
.wk-skel {
    border-radius: 18px;
    aspect-ratio: 4 / 3;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,.04) 0%,
        rgba(255,255,255,.09) 50%,
        rgba(255,255,255,.04) 100%
    );
    background-size: 200% 100%;
    animation: skelShimmer 1.5s linear infinite;
    border: 1px solid rgba(42,125,216,.09);
}
@keyframes skelShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ══ LOADING / EMPTY ═════════════════════════════════════════════ */
.loading-message,
.no-projects {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(42,125,216,.5);
}
.loading-message i {
    font-size: 36px;
    display: block;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}
.no-projects i {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    opacity: .3;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══ RESPONSIVE ══════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 18px;
    }
}
@media (max-width: 600px) {
    .grid { grid-template-columns: 1fr; gap: 14px; }
    .project-title { font-size: 12px; }
    .project-actions { flex-direction: column; }
    .btn-pdf { width: 100%; }
}