/* =============================================
   Teacher Manager - Frontend Styles
   ============================================= */

/* ---- Original Card Style ([teachers]) ---- */
.tm-teachers-grid {
    display: grid;
    gap: 25px;
    padding: 20px 0;
}
.tm-cols-1 { grid-template-columns: 1fr; }
.tm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tm-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tm-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .tm-cols-3, .tm-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .tm-cols-2, .tm-cols-3, .tm-cols-4 { grid-template-columns: 1fr; }
}

.tm-teacher-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.tm-teacher-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.tm-teacher-photo {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
}
.tm-teacher-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tm-no-photo-front {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    background: linear-gradient(135deg, #e8e8e8, #f5f5f5);
}
.tm-teacher-content {
    padding: 18px;
}
.tm-teacher-groups {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.tm-group-tag {
    display: inline-block;
    background: #e8f0fe;
    color: #1a56db;
    font-size: 0.75em;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 500;
}
.tm-teacher-name {
    margin: 0 0 5px 0;
    font-size: 1.15em;
    color: #222;
    line-height: 1.3;
}
.tm-teacher-position {
    margin: 0 0 10px 0;
    color: #0066cc;
    font-size: 0.9em;
    font-weight: 500;
}
.tm-teacher-education {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85em;
}
.tm-teacher-education strong {
    display: block;
    margin-bottom: 5px;
    color: #444;
}
.tm-teacher-education ul {
    margin: 0;
    padding-left: 18px;
}
.tm-teacher-education li {
    margin-bottom: 3px;
    color: #555;
    line-height: 1.5;
}
.tm-teacher-contact {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tm-contact-link {
    display: inline-block;
    color: #555;
    text-decoration: none;
    font-size: 0.85em;
    transition: color 0.2s;
}
a.tm-contact-link:hover {
    color: #0066cc;
}


/* =============================================
   SPU Grouped Style ([teachers_grouped])
   ============================================= */

.tm-grouped-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 0;
}

/* Section */
.tm-group-section {
    margin-bottom: 50px;
}

/* Section Header */
.tm-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 3px solid #4338ca;
}
.tm-group-header-bar {
    width: 6px;
    height: 32px;
    background: #4338ca;
    border-radius: 3px;
    flex-shrink: 0;
}
.tm-group-title {
    margin: 0;
    font-size: 1.35em;
    font-weight: 800;
    color: #1e1b4b;
    line-height: 1.2;
}
.tm-group-count {
    font-size: 0.78em;
    padding: 3px 12px;
    border-radius: 20px;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
    white-space: nowrap;
}

/* SPU Grid */
.tm-spu-grid {
    display: grid;
    gap: 28px;
}
.tm-spu-grid.tm-cols-1 { grid-template-columns: 1fr; }
.tm-spu-grid.tm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tm-spu-grid.tm-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tm-spu-grid.tm-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .tm-spu-grid.tm-cols-3,
    .tm-spu-grid.tm-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .tm-spu-grid.tm-cols-2,
    .tm-spu-grid.tm-cols-3,
    .tm-spu-grid.tm-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* Hidden card (show more toggle) */
.tm-hidden-card {
    display: none;
}
.tm-hidden-card.tm-visible {
    display: block;
}

/* SPU Card */
.tm-spu-card {
    text-align: center;
    transition: transform 0.3s ease;
}
.tm-spu-card:hover {
    transform: translateY(-4px);
}

/* SPU Photo */
.tm-spu-photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f0f5, #e8e8f0);
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s ease;
    position: relative;
}
.tm-spu-card:hover .tm-spu-photo {
    box-shadow: 0 12px 28px rgba(67, 56, 202, 0.15);
}
.tm-spu-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.tm-spu-card:hover .tm-spu-photo img {
    transform: scale(1.03);
}
.tm-spu-no-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    background: linear-gradient(135deg, #e8e8f0, #f0f0f5);
}

/* Bottom accent line */
.tm-spu-photo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: #4338ca;
    transition: height 0.3s ease;
}
.tm-spu-card:hover .tm-spu-photo::after {
    height: 4px;
}

/* SPU Info */
.tm-spu-info {
    padding: 0 4px;
}
.tm-spu-name {
    margin: 0 0 4px;
    font-size: 0.95em;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.4;
}
.tm-spu-position {
    margin: 0;
    font-size: 0.82em;
    color: #6b7280;
    line-height: 1.5;
}

/* SPU Education */
.tm-spu-education {
    margin-top: 8px;
    text-align: left;
}
.tm-spu-edu-item {
    font-size: 0.78em;
    color: #6b7280;
    line-height: 1.6;
    padding-left: 12px;
    border-left: 2px solid #e5e7eb;
    margin-bottom: 4px;
}

/* SPU Contact Icons */
.tm-spu-contact {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.tm-spu-contact a,
.tm-spu-contact span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f3f4f6;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}
.tm-spu-contact a:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(67,56,202,0.25);
}

/* Show More Button */
.tm-show-more-wrap {
    text-align: center;
    margin-top: 24px;
}
.tm-show-more-btn {
    padding: 10px 32px;
    border-radius: 8px;
    border: 2px solid #4338ca;
    background: transparent;
    color: #4338ca;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.tm-show-more-btn:hover {
    background: #4338ca;
    color: #fff;
    box-shadow: 0 4px 12px rgba(67,56,202,0.3);
}
.tm-show-more-btn.tm-expanded {
    background: #4338ca;
    color: #fff;
}

/* Animation */
@keyframes tmFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.tm-spu-grid-item {
    animation: tmFadeIn 0.4s ease both;
}
.tm-spu-grid-item:nth-child(1) { animation-delay: 0s; }
.tm-spu-grid-item:nth-child(2) { animation-delay: 0.05s; }
.tm-spu-grid-item:nth-child(3) { animation-delay: 0.1s; }
.tm-spu-grid-item:nth-child(4) { animation-delay: 0.15s; }
.tm-spu-grid-item:nth-child(5) { animation-delay: 0.2s; }
.tm-spu-grid-item:nth-child(6) { animation-delay: 0.25s; }
