/* Interactive Testimonial Tabs - Frontend Styles */

.itt-testimonial-tabs-container {
    display: flex;
    gap: 0.5rem; /* Khoảng cách giữa các tabs */
    justify-content: center;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-radius: 20px;
    overflow: visible; /* Cho phép nhìn thấy khoảng cách */
    padding: 0.5rem; /* Padding để tạo background xung quanh */
}

.itt-tab {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 400px;
    width: 160px;
    flex: 0 0 auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    color: white;
    border-radius: 15px;
}

.itt-tab.itt-active {
    width: 500px;
}

/* Color Classes */
.itt-pink {
    background: linear-gradient(135deg, #f4a6d7 0%, #e91e63 100%);
}

.itt-green {
    background: linear-gradient(135deg, #a8d5ba 0%, #4caf50 100%);
}

.itt-blue {
    background: linear-gradient(135deg, #a8c8e1 0%, #2196f3 100%);
}

.itt-purple {
    background: linear-gradient(135deg, #d4a8d8 0%, #9c27b0 100%);
}

.itt-tab.itt-active.itt-blue {
    background: linear-gradient(135deg, #1a4d4d 0%, #0d3333 100%);
}

.itt-avatar-container {
    width: 160px;
    min-width: 160px;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
}

.itt-avatar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.itt-avatar {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    object-fit: cover;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    transition: width 0.4s cubic-bezier(0.4,0,0.2,1), height 0.4s cubic-bezier(0.4,0,0.2,1);
}

.itt-tab.itt-active .itt-avatar {
    width: calc(100% - 0.8rem) !important;
    height: calc(100% - 0.8rem) !important;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.15);
}

/* Avatar placeholder (text) styling */
.itt-avatar.itt-avatar-placeholder {
    border-radius: 0;
    background: rgba(255, 255, 255, 0.1);
}

.itt-logo-wrapper {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 3;
}

.itt-company-logo {
    width: 50px !important;
    height: 40px !important;
    background: white;
    border-radius: 8px !important;
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
    object-fit: cover !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: bold !important;
    color: #333 !important;
}

.itt-content {
    flex: 1 1 0;
    position: relative;
    padding: 20px;
    opacity: 0;
    display: none;
    color: #111;
    background: transparent;
    z-index: 2;
    flex-direction: column;
    justify-content: center;
}

.itt-tab.itt-active .itt-content {
    opacity: 1;
    display: flex;
}

.itt-tab:not(.itt-active) .itt-content {
    display: none;
}

.itt-quote {
    font-size: 18px;
    line-height: 1.6;
    margin: 0 0 20px;
    font-style: italic;
    position: relative;
}

.itt-quote::before {
    display: none;
}

.itt-author-info {
    margin-top: auto;
}

.itt-author-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}

.itt-author-details {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

.itt-category-label {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.4s ease;
}

.itt-tab.itt-active .itt-category-label {
    opacity: 0;
    transform: translateY(-10px);
}

.itt-category-description {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease 0.2s;
    line-height: 1.4;
}

.itt-tab.itt-active .itt-category-description {
    opacity: 0.9;
    transform: translateY(0);
}

/* Hover Effects */
.itt-tab:not(.itt-active):hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Focus states for accessibility */
.itt-tab:focus {
    outline: none !important;
    box-shadow: none !important;
}

.itt-tab:focus:not(.itt-active) {
    transform: scale(1.02);
}

/* Responsive Design */
@media (max-width: 768px) {
    .itt-testimonial-tabs-container {
        flex-direction: column;
        gap: 0.5rem; /* Giữ gap cho mobile */
        margin: 20px;
        border-radius: 15px;
        padding: 0.5rem;
    }
    
    .itt-tab {
        width: 100%;
        height: 200px; /* Fixed height cho mobile */
    }
    
    .itt-tab.itt-active {
        width: 100%;
        height: 300px; /* Tăng height khi active */
    }
    
    .itt-avatar-container {
        width: 100%; /* Mobile: avatar full width */
    }
    
    .itt-avatar {
        font-size: 32px; /* Smaller font size cho mobile */
    }
    
    .itt-logo-wrapper {
        bottom: 15px;
        left: 15px;
    }
    
    .itt-company-logo {
        width: 30px;
        height: 30px;
    }
    
    .itt-content {
        left: 0; /* Mobile: content overlay full */
        width: 100%;
        padding: 15px;
        background: rgba(0, 0, 0, 0.4); /* Mobile có overlay để đọc được text */
    }
    
    .itt-quote {
        font-size: 16px;
    }
    
    .itt-category-label {
        bottom: 15px;
        left: 15px;
        font-size: 14px;
    }
    
    .itt-category-description {
        bottom: 15px;
        left: 15px;
        right: 15px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .itt-testimonial-tabs-container {
        margin: 10px;
    }
    
    .itt-tab {
        min-height: 150px;
    }
    
    .itt-tab.itt-active {
        min-height: 250px;
    }
}

/* Animation when loading */
.itt-testimonial-tabs-container {
    animation: fadeInUp 0.8s ease;
}

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

/* Smooth loading animation for individual tabs */
.itt-tab {
    animation: slideIn 0.6s ease forwards;
}

.itt-tab:nth-child(1) { animation-delay: 0.1s; }
.itt-tab:nth-child(2) { animation-delay: 0.2s; }
.itt-tab:nth-child(3) { animation-delay: 0.3s; }
.itt-tab:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile accordion styles */
.itt-mobile-view .itt-tab {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.itt-mobile-view .itt-tab:last-child {
    border-bottom: none;
}

/* Loading states */
.itt-loading .itt-avatar,
.itt-loading .itt-company-logo {
    background: rgba(255, 255, 255, 0.3);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Error states */
.itt-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px;
}

/* Multiple testimonials dots (for future feature) */
.itt-testimonial-dots {
    position: absolute;
    bottom: 60px;
    left: 20px;
    display: flex;
    gap: 8px;
}

.itt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.itt-dot.active,
.itt-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .itt-tab {
        border: 2px solid white;
    }
    
    .itt-avatar,
    .itt-company-logo {
        border-color: white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .itt-tab,
    .itt-content,
    .itt-category-label,
    .itt-category-description,
    .itt-testimonial-tabs-container {
        animation: none;
        transition: none;
    }
}

/* Print styles */
@media print {
    .itt-testimonial-tabs-container {
        display: block;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .itt-tab {
        display: block;
        width: 100%;
        margin-bottom: 20px;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .itt-content {
        opacity: 1;
        transform: none;
    }
    
    .itt-category-description {
        opacity: 1;
        transform: none;
    }
}

.itt-more-testimonials {
    display: flex;
    align-items: center;
    margin-top: 24px;
    gap: 10px;
    justify-content: flex-end;
}

.itt-more-label {
    font-size: 12px;
    color: #333;
    margin-right: 10px;
    font-weight: 500;
}

.itt-more-avatars {
    display: flex;
    align-items: center;
    gap: 0;
}

.itt-more-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    margin-left: -10px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 1;
    position: relative;
}

.itt-more-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.itt-more-avatar.active,
.itt-more-avatar:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 2;
}

.itt-more-avatar-plus {
    background: #222;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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