/**
 * AT Team Directory — Frontend (Premium)
 * by Altechmind
 */

/* ═══ DIRECTORY CONTAINER ═══ */

.atd-directory {
    display: grid;
    gap: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--atd-text, #1e293b);
    margin: 16px 0;
}

/* ═══════════════════════════
   GRID MODE
   ═══════════════════════════ */

.atd-mode-grid {
    grid-template-columns: repeat(var(--atd-cols, 3), 1fr);
}

.atd-mode-grid .atd-card {
    background: var(--atd-bg, #ffffff);
    border: 1px solid var(--atd-border, #e2e8f0);
    border-radius: var(--atd-radius, 12px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px 24px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}

/* Accent top line */
.atd-mode-grid .atd-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--atd-accent, #7c3aed);
    opacity: 0;
    transition: opacity 0.25s;
}
.atd-hover .atd-mode-grid .atd-card:hover::before,
.atd-mode-grid .atd-card:focus-within::before {
    opacity: 1;
}

.atd-mode-grid .atd-card-visual {
    margin-bottom: 18px;
}

.atd-mode-grid .atd-card-photo {
    position: relative;
}

.atd-mode-grid .atd-card-photo img {
    width: var(--atd-img, 160px);
    height: var(--atd-img, 160px);
    object-fit: cover;
    display: block;
    border: 3px solid var(--atd-border, #e2e8f0);
    transition: border-color 0.25s;
}
.atd-hover .atd-mode-grid .atd-card:hover .atd-card-photo img {
    border-color: var(--atd-accent, #7c3aed);
}

.atd-mode-grid .atd-card-photo-link {
    display: block;
    text-decoration: none;
}

/* ═══════════════════════════
   LIST MODE
   ═══════════════════════════ */

.atd-mode-list {
    grid-template-columns: repeat(var(--atd-cols, 1), 1fr);
}

.atd-mode-list .atd-card {
    background: var(--atd-bg, #ffffff);
    border: 1px solid var(--atd-border, #e2e8f0);
    border-radius: var(--atd-radius, 12px);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
    padding: 24px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    border-left: 3px solid transparent;
}
.atd-hover .atd-mode-list .atd-card:hover {
    border-left-color: var(--atd-accent, #7c3aed);
}

.atd-mode-list .atd-card-visual {
    flex-shrink: 0;
}

.atd-mode-list .atd-card-photo img {
    width: var(--atd-img, 120px);
    height: var(--atd-img, 120px);
    object-fit: cover;
    display: block;
    border: 2px solid var(--atd-border, #e2e8f0);
    transition: border-color 0.25s;
}
.atd-hover .atd-mode-list .atd-card:hover .atd-card-photo img {
    border-color: var(--atd-accent, #7c3aed);
}

.atd-mode-list .atd-card-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.atd-mode-list .atd-card-photo-link { display: block; text-decoration: none; }

/* ═══════════════════════════
   COMPACT MODE
   ═══════════════════════════ */

.atd-mode-compact {
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid var(--atd-border, #e2e8f0);
    border-radius: var(--atd-radius, 12px);
    overflow: hidden;
    background: var(--atd-bg, #ffffff);
}

.atd-mode-compact .atd-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--atd-border, #e2e8f0);
    transition: background 0.15s, padding-left 0.15s;
}
.atd-mode-compact .atd-card:last-child { border-bottom: none; }
.atd-hover .atd-mode-compact .atd-card:hover {
    background: rgba(124, 58, 237, 0.03);
    padding-left: 22px;
}

.atd-mode-compact .atd-card-photo img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    display: block;
}

.atd-mode-compact .atd-card-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.atd-mode-compact .atd-card-name { font-size: 14px; margin: 0 0 1px; }
.atd-mode-compact .atd-card-designation { font-size: 12px; }
.atd-mode-compact .atd-card-department { font-size: 11px; }
.atd-mode-compact .atd-card-photo-link { display: block; text-decoration: none; flex-shrink: 0; }

/* ═══════════════════════════
   IMAGE SHAPES
   ═══════════════════════════ */

.atd-img-circle .atd-card-photo img { border-radius: 50%; }
.atd-img-rounded .atd-card-photo img { border-radius: 14px; }
.atd-img-square .atd-card-photo img { border-radius: var(--atd-radius, 12px); }

/* No-photo state */
.atd-card--no-photo .atd-card-photo img {
    opacity: 0.7;
}

/* ═══════════════════════════
   SHADOW & HOVER
   ═══════════════════════════ */

.atd-shadow .atd-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
}
.atd-hover .atd-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
}

.atd-mode-compact.atd-shadow { box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04); }
.atd-mode-compact.atd-shadow .atd-card { box-shadow: none; }
.atd-mode-compact.atd-hover .atd-card:hover { transform: none; box-shadow: none; }

/* ═══════════════════════════
   CARD ELEMENTS
   ═══════════════════════════ */

.atd-card-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--atd-text, #1e293b);
    margin: 0 0 6px;
    line-height: 1.3;
}

.atd-card-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}
.atd-card-name a:hover {
    color: var(--atd-accent, #7c3aed);
}

.atd-card-qual {
    font-weight: 400;
    font-size: 0.82em;
    color: var(--atd-accent, #7c3aed);
}

.atd-card-designation {
    font-size: 13px;
    font-weight: 600;
    color: var(--atd-accent, #7c3aed);
    margin-bottom: 3px;
    letter-spacing: -0.1px;
}

.atd-card-department {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
    line-height: 1.4;
}

.atd-card-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 10px;
}
.atd-mode-grid .atd-card-location { justify-content: center; }

.atd-card-bio {
    font-size: 13px;
    color: #475569;
    line-height: 1.65;
    margin: 10px 0 0;
}

/* ═══ CONTACT ═══ */

.atd-card-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--atd-border, #e2e8f0);
}

.atd-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
    text-decoration: none;
    transition: color 0.15s;
}

.atd-contact-item svg {
    flex-shrink: 0;
    color: #94a3b8;
}

.atd-contact-email:hover {
    color: var(--atd-accent, #7c3aed);
}
.atd-contact-email:hover svg {
    color: var(--atd-accent, #7c3aed);
}

.atd-mode-grid .atd-card-contact { align-items: center; }

/* ═══ SOCIAL ═══ */

.atd-card-social {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.atd-mode-grid .atd-card-social { justify-content: center; }

.atd-social-link {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}

.atd-social-link:hover {
    color: #fff;
    background: var(--atd-accent, #7c3aed);
    border-color: var(--atd-accent, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}

.atd-social-link svg { display: block; }

/* Text-based icons for academic platforms — ensure proper rendering. */
.atd-social-link svg text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    pointer-events: none;
}

/* ═══ PROFILE LINK ═══ */

.atd-card-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--atd-accent, #7c3aed);
    text-decoration: none;
    transition: gap 0.15s;
}
.atd-card-profile-link:hover {
    gap: 8px;
    text-decoration: none;
}

/* ═══ POWERED BY ═══ */

.atd-powered {
    grid-column: 1 / -1;
    text-align: center;
    padding: 14px 0 0;
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 0.3px;
}


/* ═══════════════════════════════════
   SINGLE PROFILE PAGE
   ═══════════════════════════════════ */

.atd-profile {
    max-width: 760px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.atd-profile-inner {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.atd-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    padding: 36px 36px 28px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
}

.atd-profile-photo {
    flex-shrink: 0;
}

.atd-profile-photo img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.atd-profile-identity {
    flex: 1;
    min-width: 0;
    padding-top: 6px;
}

.atd-profile-name {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
    line-height: 1.2;
    letter-spacing: -0.4px;
}

.atd-profile-qual {
    font-weight: 400;
    font-size: 0.75em;
    color: var(--atd-accent, #7c3aed);
}

.atd-profile-designation {
    font-size: 16px;
    font-weight: 600;
    color: var(--atd-accent, #7c3aed);
    margin-bottom: 4px;
}

.atd-profile-department {
    font-size: 14px;
    color: #475569;
    margin-bottom: 6px;
    line-height: 1.4;
}

.atd-profile-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 10px;
}
.atd-profile-location svg { flex-shrink: 0; }

.atd-profile-groups {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.atd-profile-group {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(124,58,237,0.08);
    color: var(--atd-accent, #7c3aed);
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Profile sections */
.atd-profile-section {
    padding: 24px 36px;
    border-bottom: 1px solid #f1f5f9;
}
.atd-profile-section:last-of-type { border-bottom: none; }

.atd-profile-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    margin: 0 0 12px;
}

.atd-profile-bio {
    font-size: 15px;
    color: #334155;
    line-height: 1.75;
}
.atd-profile-bio p { margin: 0 0 12px; }
.atd-profile-bio p:last-child { margin-bottom: 0; }

/* Contact list */
.atd-profile-contact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.atd-profile-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #334155;
    text-decoration: none;
    transition: color 0.15s;
}
.atd-profile-contact-item svg { color: #94a3b8; flex-shrink: 0; }
a.atd-profile-contact-item:hover { color: var(--atd-accent, #7c3aed); }
a.atd-profile-contact-item:hover svg { color: var(--atd-accent, #7c3aed); }

/* Social links on profile */
.atd-profile-social {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.atd-profile-social-item {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition: all 0.15s;
}
.atd-profile-social-item:hover {
    border-color: var(--atd-accent, #7c3aed);
    background: rgba(124,58,237,0.04);
    color: var(--atd-accent, #7c3aed);
}
.atd-profile-social-item svg { color: #94a3b8; transition: color 0.15s; }
.atd-profile-social-item:hover svg { color: var(--atd-accent, #7c3aed); }

/* Profile footer */
.atd-profile-footer {
    padding: 12px 36px;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    background: #fafbff;
    border-top: 1px solid #f1f5f9;
}


/* ═══════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════ */

@media (max-width: 1024px) {
    .atd-mode-grid {
        grid-template-columns: repeat(min(var(--atd-cols, 3), 3), 1fr);
    }
}

@media (max-width: 768px) {
    .atd-mode-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .atd-mode-grid .atd-card {
        padding: 24px 18px 20px;
    }
    .atd-mode-list .atd-card {
        gap: 16px;
        padding: 18px;
    }
    .atd-mode-list .atd-card-photo img {
        width: 80px;
        height: 80px;
    }

    /* Profile page */
    .atd-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        padding: 28px 24px 22px;
    }
    .atd-profile-photo img { width: 120px; height: 120px; }
    .atd-profile-identity { padding-top: 0; }
    .atd-profile-location { justify-content: center; }
    .atd-profile-groups { justify-content: center; }
    .atd-profile-name { font-size: 22px; }
    .atd-profile-section { padding: 20px 24px; }
}

@media (max-width: 520px) {
    .atd-mode-grid {
        grid-template-columns: 1fr;
    }
    .atd-mode-grid .atd-card-photo img {
        width: 120px;
        height: 120px;
    }
    .atd-mode-list .atd-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    .atd-mode-list .atd-card-info { text-align: center; }
    .atd-mode-list .atd-card-social { justify-content: center; }
    .atd-mode-list .atd-card-contact { align-items: center; }
    .atd-mode-list .atd-card-location { justify-content: center; }
    .atd-mode-compact .atd-card { padding: 12px 14px; gap: 12px; }

    .atd-profile { margin: 20px auto; padding: 0 12px; }
    .atd-profile-inner { border-radius: 12px; }
    .atd-profile-photo img { width: 100px; height: 100px; }
}

@media print {
    .atd-card { box-shadow: none !important; break-inside: avoid; }
    .atd-hover .atd-card:hover { transform: none !important; }
    .atd-profile-inner { box-shadow: none; border: 1px solid #ccc; }
}
