/**
 * Team Tabs & Bio Modal - Frontend Styles
 * 
 * @package Team_Tabs_Bio
 */

/* ==========================================================================
   Container & Layout
   ========================================================================== */

.ttb-container {
    display: flex;
    gap: 2rem;
    max-width: 100%;
    margin: 0;
    font-family: 'Manrope', Helvetica, Arial, Lucida, sans-serif;
}

/* ==========================================================================
   Tabs (Left Sidebar)
   ========================================================================== */

.ttb-tabs-wrapper {
    flex: 0 0 310px;
    min-width: 200px;
}

.ttb-tabs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    list-style: none !important;
}

.ttb-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 22px;
    background: transparent;
    color: #E5DCCE;
    font-size: 21px;
    font-weight: normal;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border: 0;
}

.ttb-tab:hover {
    background: #D9D9D9;
    border-color: #D9D9D9;
    color: #1C5678;
}

.ttb-tab:focus {
    z-index: 1;
}

.ttb-tab-active,
.ttb-tab-active:hover {
    background: #D9D9D9;
    border-color: #D9D9D9;
    color: #1C5678;
}

.ttb-tab-text {
    flex: 1;
    line-height: 1.4;
}

.ttb-tab-count {
    background: rgba(255, 255, 255, 0.2);
    color: currentColor;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
    display: none;
}

.ttb-tab-active .ttb-tab-count {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Panels (Main Content Area)
   ========================================================================== */

.ttb-panels {
    flex: 1;
    min-width: 0;
}

.ttb-panel {
    display: none;
}

.ttb-panel-active {
    display: block;
}

.ttb-panel-title {
    /* Screen reader only */
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.ttb-panel-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { 
        max-height: 0; 
        padding: 0; 
        opacity: 0; 
    }
    to { 
        max-height: 2000px; 
        padding: 1rem; 
        opacity: 1; 
    }
}

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

.ttb-members-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 0;
}

.ttb-no-members {
    grid-column: 1 / -1;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 3rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ==========================================================================
   Person Cards
   ========================================================================== */

.ttb-person-card {
    padding: 0;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.ttb-person-photo {
    position: relative;
    margin-bottom: 1rem;
}

.ttb-person-photo img {
    width: 190px;
    height: 190px;
    object-fit: cover;
}

.ttb-person-photo-placeholder {
    width: 190px;
    height: 190px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 5rem;
    color: #adb5bd;
}

.ttb-contact-icons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.ttb-contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--ttb-accent-color, #007cba);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ttb-contact-icon:hover {
    background: #0056b3;
    transform: scale(1.1);
}

/* ==========================================================================
   Person Info
   ========================================================================== */

.ttb-person-info {
    flex: 1;
}

.ttb-person-name {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem 0;
    line-height: 1.6;
    padding-bottom: 0;
}

.ttb-person-role {
    font-size: 21px;
    color: #fff;
    margin: 0;
    padding: 0;
    font-weight: 400;
    line-height: 1.6;
}

.ttb-view-bio-btn {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: transparent;
    color: #E5DCCE;
    border: none;
    padding: 0;
    font-size: 21px;
    cursor: pointer;
    text-decoration: none;
}

.ttb-btn-icon {
    font-size: 21px;
    transition: transform 0.2s ease;
}


/* ==========================================================================
   Modal
   ========================================================================== */

.ttb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ttb-modal.ttb-modal-open {
    opacity: 1;
    visibility: visible;
}

.ttb-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 86, 120, 0.85);
    cursor: pointer;
}

.ttb-modal-container {
    position: relative;
    width: 90%;
    max-width: var(--ttb-modal-max-width, 960px);
    max-height: 80vh;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.ttb-modal-open .ttb-modal-container {
    transform: scale(1) translateY(0);
}

.ttb-modal-content {
    position: relative;
    height: 100%;
}

.ttb-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    color: #1D1B20;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 1;
}

.ttb-modal-body {
    padding: 50px;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    gap: 40px;
}

.ttb-modal-left-section {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.ttb-modal-right-section {
    flex: 1;
    min-width: 0;
}

.ttb-modal-photo img {
    width: 190px;
    height: 190px;
    object-fit: cover;
}

.ttb-modal-header {
    margin-bottom: 0;
}

.ttb-modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #1B2D38;
    margin: 0;
    line-height: 1.4;
}

.ttb-modal-role {
    color: #1B2D38;
}

.ttb-modal-bio {
    color: #1B2D38;
    line-height: 1.6;
    margin: 0;
    font-size: 16px;
}

.ttb-modal-bio p:last-child {
    margin-bottom: 0;
}

.ttb-modal-contacts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.ttb-modal-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ttb-email-btn {
    background: #28a745;
    color: white;
}

.ttb-email-btn:hover {
    background: #218838;
    color: white;
}

.ttb-linkedin-btn {
    background: #0077b5;
    color: white;
}

.ttb-linkedin-btn:hover {
    background: #005582;
    color: white;
}

/* ==========================================================================
   Linear Display Mode
   ========================================================================== */

.ttb-linear-mode {
    display: block;
}

.ttb-linear-mode .ttb-tabs-wrapper {
    display: none;
}

.ttb-linear-mode .ttb-panels {
    display: block;
}

.ttb-linear-mode .ttb-panel {
    display: block;
    margin-bottom: 3rem;
}

.ttb-linear-mode .ttb-panel:last-child {
    margin-bottom: 0;
}

.ttb-team-heading {
    font-size: 2rem;
    font-weight: 700;
    color: #1C5678;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--ttb-accent-color, #007cba);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ttb-team-count {
    background: var(--ttb-accent-color, #007cba);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.ttb-linear-mode .ttb-panel-content {
    animation: none;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1200px) {
    .ttb-members-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 991px) {
    .ttb-members-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .ttb-container {
        flex-direction: column;
        gap: 0;
    }
    
    /* Accordion Mode Styles */
    .ttb-container.ttb-accordion-mode {
        display: flex;
        flex-direction: column;
    }
    
    .ttb-container.ttb-accordion-mode .ttb-tabs-wrapper {
        display: none;
    }
    
    .ttb-container.ttb-accordion-mode .ttb-panels {
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    
    .ttb-container.ttb-accordion-mode .ttb-panel {
        margin-bottom: 0.5rem;
        overflow: hidden;
        display: block;
        position: relative;
    }
    
    .ttb-container.ttb-accordion-mode .ttb-panel::before {
        content: attr(data-team-name);
        display: block;
        background: transparent;
        color: #E5DCCE;
        padding: 15px 22px;
        font-size: 21px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
    }
    
    .ttb-container.ttb-accordion-mode .ttb-panel::after {
        content: url("../../assets/icons/expand-icon.svg");
        position: absolute;
        right: 22px;
        top: 15px;
        font-size: 24px;
        font-weight: bold;
        color: #E5DCCE;
        transition: transform 0.2s ease;
    }
    
    .ttb-container.ttb-accordion-mode .ttb-panel-active::before {
        background: #D9D9D9;
        color: #1C5678;
        border-bottom-color: #D9D9D9;
    }

    .ttb-panel-linear::before {
        display: none !important;
    }
    
    .ttb-container.ttb-accordion-mode .ttb-panel-active::after {
        content: url("../../assets/icons/close-icon.svg");
        color: #1C5678;
    }
    
    .ttb-container.ttb-accordion-mode .ttb-panel-content {
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    }
    
    .ttb-container.ttb-accordion-mode .ttb-panel-active .ttb-panel-content {
        max-height: 100%;
        padding: 1rem;
        transition: max-height 0.3s ease-in, padding 0.3s ease-in;
    }
    
    /* Fallback for non-accordion mode */
    .ttb-tabs-wrapper {
        flex: none;
        width: 100%;
    }
    
    .ttb-tabs {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
        scrollbar-width: thin;
    }
    
    .ttb-tabs::-webkit-scrollbar {
        height: 4px;
    }
    
    .ttb-tabs::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }
    
    .ttb-tabs::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 2px;
    }
    
    .ttb-tab {
        flex: 0 0 auto;
        min-width: 120px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .ttb-members-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .ttb-person-card {
        padding: 0;
    }
    
    .ttb-person-photo img,
    .ttb-person-photo-placeholder {
        width: 190px;
        height: 190px;
    }
    
    .ttb-modal-container {
        width: 95%;
        max-height: 90vh;
    }
    
    .ttb-modal-body {
        padding: 1.5rem;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .ttb-modal-left-section {
        flex: none;
        width: 100%;
        order: 1;
    }
    
    .ttb-modal-right-section {
        flex: none;
        width: 100%;
        order: 2;
    }
    
    .ttb-modal-header {
        text-align: center;
        margin-bottom: 0;
    }
    
    .ttb-modal-contacts {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .ttb-members-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ttb-person-card {
        padding: 1rem;
    }
    
    .ttb-person-photo img,
    .ttb-person-photo-placeholder {
        width: 190px;
        height: 190px;
    }
    
    .ttb-person-name {
        font-size: 1.1rem;
    }
    
    .ttb-modal-body {
        padding: 1rem;
    }
    
    .ttb-modal-photo img {
        width: 190px;
        height: 190px;
    }
    
    .ttb-modal-title {
        font-size: 1.25rem;
    }
    
    .ttb-modal-contacts {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* ==========================================================================
   Accessibility & Focus States
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ttb-tab {
        border: 2px solid ButtonText;
    }
    
    .ttb-tab-active {
        background: Highlight;
        color: HighlightText;
    }
}