﻿/* ===== الكارد الأساسي ===== */
.instructor-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
}

    .instructor-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
        border-color: rgba(52, 152, 219, 0.15);
    }

    /* خط متحرك */
    .instructor-card::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #3498db, #483d8a, #f39c12, #042e6f);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.4s ease;
    }

    .instructor-card:hover::after {
        transform: scaleX(1);
    }

/* ===== الصورة ===== */
.instructor-card-header {
    position: relative;
    background: #f8f9fa;
    overflow: hidden;
    flex-shrink: 0;
    padding-top: 66.67%; /* نسبة 3:2 */
}

.image-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
}

.instructor-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.instructor-card:hover .instructor-image {
    transform: scale(1.08);
}

/* ===== جسم الكارد ===== */
.instructor-card-body {
    margin: 12px 22px 0 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* ===== الاسم ===== */
.instructor-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 22px 0 22px;
    gap: 4px;
}

.instructor-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a2e;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    text-align: right;
}

.instructor-brief {
    margin-top: 5px;
    background: rgba(52, 152, 219, 0.08);
    color: #2c3e50;
    padding: 4px 18px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    text-align: center;
    align-self: center;
    border: 1.5px solid #3498db;
    transition: all 0.3s ease;
}

    .instructor-brief:hover {
        background: rgba(52, 152, 219, 0.15);
        border-color: #2980b9;
        transform: translateY(-2px);
    }

/* ===== الحقول ===== */
.instructor-field,
.instructor-university {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    flex-wrap: wrap;
}

.instructor-field {
    border-bottom: 1px dashed #e8ecf1;
    padding-bottom: 8px;
}

.instructor-university {
    padding-top: 2px;
}

.field-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.88rem;
    min-width: 0;
    flex: 1 1 auto;
}

    .field-item i {
        font-size: 0.85rem;
        flex-shrink: 0;
        width: 18px;
        text-align: center;
    }

/* ألوان الأيقونات */
.instructor-field .field-item:first-child i {
    color: #3498db;
}

.instructor-field .degree-item i {
    color: #9b59b6;
}

.instructor-university .field-item:first-child i {
    color: #2ecc71;
}

.instructor-university .field-item:last-child i {
    color: #f39c12;
}

.field-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.field-value {
    color: #555;
    font-size: 0.88rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    min-width: 0;
}

.degree-text {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #ffffff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

/* ===== الاهتمامات البحثية ===== */
.research-section {
    margin: 4px 0 6px;
    padding-top: 8px;
    border-top: 1px solid #f0f2f5;
}

.research-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .research-label i {
        color: #8e44ad;
    }

.research-interests {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.interest-tag {
    background: #f0f7ff;
    color: #2c3e50;
    font-size: 0.75rem;
    padding: 4px 14px;
    border-radius: 30px;
    border: 1px solid #dce8f5;
    font-weight: 500;
    transition: all 0.3s ease;
    letter-spacing: 0.2px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

    .interest-tag:hover {
        background: #3498db;
        color: #ffffff;
        border-color: #3498db;
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 4px 12px rgba(52, 152, 219, 0.25);
    }

/* ===== زر جوجل سكولر ===== */
.instructor-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #f0f2f5;
}

.btn-scholar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 24px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid #4285f4;
    cursor: pointer;
    background: #ffffff;
    color: #4285f4;
    min-width: 120px;
}

    .btn-scholar:hover {
        background: #4285f4;
        color: #ffffff;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(66, 133, 244, 0.3);
    }

    .btn-scholar:active {
        transform: translateY(0);
    }

    .btn-scholar.disabled {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
        border-color: #95a5a6;
        color: #95a5a6;
    }

/* ===== معالجة الصور البديلة ===== */
.instructor-image[src*="placeholder"],
.instructor-image.error {
    object-fit: contain;
    background: #ecf0f1;
    padding: 30px;
}

/* ===== التوافق مع الشاشات الصغيرة ===== */
@media (max-width: 768px) {
    .instructor-card-header {
        padding-top: 56.25%;
    }
}

@media (max-width: 576px) {
    .instructor-card-header {
        padding-top: 60%;
    }

    .instructor-card-body {
        padding: 16px 16px 18px;
        gap: 8px;
    }

    .instructor-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 16px 0 16px;
        gap: 6px;
    }

    .instructor-brief {
        white-space: normal;
        font-size: 0.75rem;
        padding: 3px 14px;
    }

    .instructor-name {
        font-size: 0.95rem;
        margin: 10px 16px 0 16px;
        padding-bottom: 8px;
    }

    .instructor-field,
    .instructor-university {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .field-item {
        width: 100%;
    }

    .degree-text {
        white-space: normal;
    }

    .instructor-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-scholar {
        width: 100%;
        justify-content: center;
        padding: 10px 18px;
        min-width: unset;
    }

    .research-interests {
        gap: 4px;
    }

    .interest-tag {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
}

/* ===== تحسينات إضافية ===== */
.instructor-card {
    user-select: none;
}

.instructor-name a:focus-visible,
.btn-scholar:focus-visible,
.image-link:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* تأثير pulse للزر */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }

    100% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
}

.btn-scholar:not(.disabled):hover {
    animation: pulse 0.6s ease;
}
