/* Shared Teacher Cards Styles */
/* Used by both directory-teachers.php and universal-search.php */

/* Ensure teacher cards maintain their specific styling */
.result-card[data-type="teacher"] {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow: hidden;
}

.result-card[data-type="teacher"]:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.result-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.result-card[data-type="teacher"] .card-header {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 15px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card[data-type="teacher"] .card-details-wrapper {
    padding: 20px 20px 20px 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card[data-type="teacher"] .card-actions-wrapper {
    padding: 20px 20px 20px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-header {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 15px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #0073aa;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
}

.card-image-grid {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.card-image-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #0073aa;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
}

.placeholder-image {
    border-radius: 50%;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ddd;
    aspect-ratio: 1/1;
}

.placeholder-icon {
    font-size: 40px;
    color: #999;
}

.card-badges {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    background: transparent;
    padding: 0;
    border-radius: 0;
    backdrop-filter: none;
    width: calc(100% - 30px);
}

.card-badges-grid {
    display: none;
}
.card-badges-list {
    display: flex;
    position: static;
    order: 1;
    margin: 0 0 15px 0;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.kri-badges-left {
    display: flex;
    gap: 0px;
    align-items: center;
}

.kri-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    box-shadow: none;
    border: none;
    display: block;
    background: transparent;
    position: relative;
    cursor: help;
    transition: all 0.3s ease;
}

.kri-badge:hover {
    transform: scale(1.1);
}

.kri-badge-container {
    position: relative;
    display: inline-block;
}

.kri-badge-container::after {
    content: "KRI Level";
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.kri-level-1-container::after {
    content: "Level 1";
}

.kri-level-2-container::after {
    content: "Level 2";
}

.kri-level-3-container::after {
    content: "Level 3";
}

.kri-badge-container:hover::after {
    opacity: 1;
    visibility: visible;
}

.active-trainer-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(40,167,69,0.25);
    border: 2px solid #28a745;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    cursor: help;
}

.active-trainer-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(40,167,69,0.4);
}

.active-trainer-badge::after {
    content: "Active Trainer";
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.active-trainer-badge:hover::after {
    opacity: 1;
    visibility: visible;
}

.active-trainer-badge-list {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(40,167,69,0.25);
    border: 2px solid #28a745;
    font-size: 12px;
    transition: all 0.3s ease;
    position: relative;
    cursor: help;
}

.active-trainer-badge-list:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(40,167,69,0.4);
}

.active-trainer-badge-list::after {
    content: "Active Trainer";
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.active-trainer-badge-list:hover::after {
    opacity: 1;
    visibility: visible;
}

.card-details-wrapper {
    padding: 20px 20px 20px 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-content {
    flex: 1;
}

.card-title {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.card-title a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-title a:hover {
    color: #005a87;
}

.card-meta {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 0;
}

/* Adjust meta spacing for list view */
.results-grid.list-view .card-meta {
    margin-top: 5px;
    padding-top: 8px;
}

.meta-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-icon {
    font-size: 14px;
    color: #666;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 3px;
}

.meta-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}



.meta-value {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    font-weight: 500;
}

.card-actions-wrapper {
    padding: 20px 20px 20px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    padding: 8px 16px;
    border-radius: 18px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: auto;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0, 115, 170, 0.3);
}

.btn-view:hover {
    background: linear-gradient(135deg, #005a87, #004a6f);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
}

/* Grid View Styles */
.results-grid.grid-view .results-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.results-grid.grid-view .result-card {
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.results-grid.grid-view .card-header {
    width: 100%;
    height: auto;
    border-radius: 0;
    margin-left: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px 20px 0 20px;
}

.results-grid.grid-view .card-image {
    display: none;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.results-grid.grid-view .card-image-grid {
    display: block;
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    aspect-ratio: 1/1;
}

.results-grid.grid-view .card-image-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #0073aa;
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.3);
}

.results-grid.grid-view .placeholder-image.grid-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #ddd;
}

.results-grid.grid-view .placeholder-icon {
    font-size: 60px;
    color: #999;
}

.results-grid.grid-view .card-title {
    position: static;
    transform: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    z-index: auto;
    min-width: auto;
    text-align: center;
    white-space: normal;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 15px;
}

.results-grid.grid-view .card-title a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.3;
}

.results-grid.grid-view .card-details-wrapper {
    padding: 20px;
    padding-top: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.results-grid.grid-view .card-actions-wrapper {
    padding: 20px;
    padding-top: 15px;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    margin-top: 10px;
}

.results-grid.grid-view .card-badges-grid {
    display: flex;
    position: absolute;
    top: 15px;
    right: 15px;
    gap: 10px;
}

.results-grid.grid-view .kri-badge {
    width: 45px;
    height: 45px;
}

.results-grid.grid-view .card-badges-list {
    display: none;
}

/* Hide title in list view since it's now in the content area */
.results-grid.list-view .card-header .card-title {
    display: none;
}

/* Show title in list view content area */
.results-grid.list-view .card-content .card-title {
    display: block;
    margin-bottom: 8px;
}

/* Hide title in grid view content area since it's in the header */
.results-grid.grid-view .card-content .card-title {
    display: none;
}

/* List view image transitions */
.results-grid.list-view .card-image {
    display: block;
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.results-grid.list-view .card-image-grid {
    display: none;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.results-grid.grid-view .btn-view {
    width: 100%;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1200px) {
    .results-grid.grid-view .results-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .results-grid.grid-view .results-cards {
        grid-template-columns: 1fr;
    }
    
    .results-grid.list-view .result-card {
        flex-direction: column;
        align-items: stretch;
    }

    .results-grid.list-view .card-header {
        width: 100%;
        height: 200px;
        margin-left: 0;
    }

    .results-grid.list-view .card-details-wrapper {
        padding: 20px 20px 0 20px;
    }

    .results-grid.list-view .card-actions-wrapper {
        padding: 20px;
        align-items: center;
    }

    .results-grid.list-view .btn-view {
        width: auto;
    }
} 