/**
 * Team Members Styles
 *
 * Styles for team member cards and popup functionality.
 *
 * @package Team_Members
 * @since 1.0.0
 */

/* ==========================================================================
   Team Members Grid
   ========================================================================== */

.tm-team-members {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 20px 0;
}

/* ==========================================================================
   Member Card
   ========================================================================== */

.tm-member {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
}

.tm-member:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Card Image */
.tm-image {
    width: 100%;
    height: 280px;
    overflow: hidden;
    position: relative;
}

.tm-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.tm-member:hover .tm-image img {
    transform: scale(1.05);
}

/* Card Content */
.tm-member h3 {
    margin: 20px 15px 8px;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    line-height: 1.3;
}

.tm-designation {
    margin: 8px 15px;
    font-size: 15px;
    color: #e74c3c;
    font-weight: 500;
}

.tm-position {
    margin: 8px 15px 20px;
    font-size: 14px;
    color: #888;
}

/* ==========================================================================
   Responsive - Tablet
   ========================================================================== */

@media (max-width: 1024px) and (min-width: 769px) {
    .tm-team-members {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* ==========================================================================
   Responsive - Mobile Landscape
   ========================================================================== */

@media (max-width: 768px) and (min-width: 481px) {
    .tm-team-members {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .tm-image {
        height: 240px;
    }
    
    .tm-member h3 {
        font-size: 18px;
    }
}

/* ==========================================================================
   Responsive - Mobile
   ========================================================================== */

@media (max-width: 480px) {
    .tm-team-members {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px 0;
    }
    
    .tm-image {
        height: 300px;
    }
    
    .tm-member h3 {
        font-size: 18px;
        margin: 18px 15px 8px;
    }
    
    .tm-designation {
        font-size: 14px;
    }
    
    .tm-position {
        font-size: 13px;
    }
}

/* ==========================================================================
   Popup Functionality
   ========================================================================== */

/* Clickable Card Cursor */
.tm-member-clickable {
    cursor: pointer;
}

/* Popup Overlay */
.tm-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.tm-popup-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popup Container */
.tm-popup-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    position: relative;
    margin: auto;
    animation: popupSlideIn 0.3s ease;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close Button */
.tm-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tm-popup-close:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
    transform: rotate(90deg);
}

/* Popup Content */
.tm-popup-content {
    padding: 30px;
    text-align: center;
}

.tm-popup-image {
    width: 100%;
    max-width: 300px;
    height: 300px;
    margin: 0 auto 20px;
    overflow: hidden;
    border-radius: 12px;
}

.tm-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.tm-popup-name {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 20px 0 10px;
    line-height: 1.3;
}

.tm-popup-designation {
    font-size: 18px;
    color: #e74c3c;
    font-weight: 500;
    margin: 10px 0;
}

.tm-popup-position {
    font-size: 16px;
    color: #888;
    margin: 10px 0 20px;
}

.tm-popup-description {
    text-align: left;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.tm-popup-description p {
    margin-bottom: 15px;
}

.tm-popup-description h1,
.tm-popup-description h2,
.tm-popup-description h3,
.tm-popup-description h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.tm-popup-description ul,
.tm-popup-description ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

/* Hidden Popup Data */
.tm-popup-data {
    display: none !important;
}

/* ==========================================================================
   Popup Responsive - Tablet
   ========================================================================== */

@media (max-width: 768px) {
    .tm-popup-container {
        max-width: 90%;
        margin: 20px auto;
    }
    
    .tm-popup-content {
        padding: 25px 20px;
    }
    
    .tm-popup-image {
        max-width: 250px;
        height: 250px;
    }
    
    .tm-popup-name {
        font-size: 24px;
    }
    
    .tm-popup-designation {
        font-size: 16px;
    }
    
    .tm-popup-position {
        font-size: 15px;
    }
    
    .tm-popup-close {
        width: 35px;
        height: 35px;
        font-size: 24px;
        top: 10px;
        right: 10px;
    }
}

/* ==========================================================================
   Popup Responsive - Mobile
   ========================================================================== */

@media (max-width: 480px) {
    .tm-popup-overlay {
        padding: 10px;
    }
    
    .tm-popup-container {
        max-width: 100%;
        margin: 10px auto;
    }
    
    .tm-popup-content {
        padding: 20px 15px;
    }
    
    .tm-popup-image {
        max-width: 200px;
        height: 200px;
    }
    
    .tm-popup-name {
        font-size: 22px;
    }
    
    .tm-popup-designation {
        font-size: 15px;
    }
    
    .tm-popup-position {
        font-size: 14px;
    }
    
    .tm-popup-description {
        font-size: 14px;
    }
}
