:root {
    /* Colors */
    --primary-color: #b30000;
    --primary-light-color: #f76969;
    --secondary-color: #1A2F51;
    --accent-color: #d30007;
    --background-color: #f9f9f9;
    --text-color: #1A2F51;
    --white: #ffffff;
    --light-gray: #f0f0f0;
    --medium-gray: #e0e0e0;
    --dark-gray: #464646;
    --border-color: #ddd;
    --warning: #ffcc00;
    --success: #28a745;
    /* Shadows */
    --shadow-light: 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 10px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 5px 15px rgba(0, 0, 0, 0.2);
    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-normal: 0.4s ease;
}


/* ===== BASE STYLES ===== */

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden;
}


/* Instructor Profile */

.instructor-profile {
    background: rgb(255, 255, 255);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(-45deg, var(--primary-color) 0%, var(--primary-light-color) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

.profile-avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 5px solid white;
    object-fit: cover;
    margin: 0 auto 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.instructor-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.instructor-title {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.experience-badge {
    display: inline-block;
    background: var(--white);
    color: var(--primary-color);
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.rating-stars {
    color: var(--warning);
    font-size: 24px;
    margin: 15px 0;
}

.rating-text {
    font-size: 18px;
    margin-bottom: 10px;
}

.profile-body {
    display: flex;
    flex-wrap: wrap;
    padding: 40px 30px;
}

.info-section {
    flex: 1;
    min-width: 300px;
    padding: 0 30px 30px 0;
}

.section-title {
    font-size: 24px;
    color: var(--secondary-color);
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E8E8E8;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 70px;
    height: 2px;
    background: var(--primary-color);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background: var(--light);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: var(--light-gray);
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.contact-text {
    flex: 1;
}

.contact-label {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 5px;
}

.contact-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.gallery-section {
    flex: 1;
    min-width: 300px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    height: 150px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    font-size: 13px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}


/* Reviews Section */

.reviews-section {
    margin-top: 40px;
    padding: 40px 30px;
    border-top: 1px solid #E8E8E8;
}


/* Form Styles */

.review-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
    border: 1px solid #e9ecef;
}

.review-form h3 {
    color: #b30000;
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-align: center;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.half {
    flex: 1;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #b30000;
    box-shadow: 0 0 0 3px rgba(179, 0, 0, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}


/* Fixed Star Rating - UPDATED */

.star-rating {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
    justify-content: center;
    align-items: center;
    min-height: 60px;
}

.star {
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.star:hover {
    color: #ffc107;
    transform: scale(1.3);
}

.star.active {
    color: #ffc107;
}


/* Ensure proper star colors */

.star i {
    pointer-events: none;
    /* Prevent icon from blocking click */
}


/* Error state for star rating */

.star-rating.error {
    border: 2px solid #dc3545;
    background: #fff5f5;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-8px);
    }
    75% {
        transform: translateX(8px);
    }
}


/* Rating requirement text */

.rating-required {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
    text-align: center;
    display: none;
    font-weight: 500;
}

.star-rating.error+.rating-required {
    display: block;
}


/* Modal fixes */

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
}

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

.modal-success-icon {
    font-size: 60px;
    color: #28a745;
    margin-bottom: 20px;
}

.modal-title {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-message {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 16px;
}

.modal-close-btn {
    background: #b30000;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
}

.modal-close-btn:hover {
    background: #990000;
    transform: translateY(-2px);
}


/* Loading state improvements */

#formLoading {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 30px;
    margin: 20px 0;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #b30000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loading p {
    color: #666;
    font-size: 16px;
    margin: 0;
}


/* Better focus styles */

.star:focus {
    outline: 3px solid #b30000;
    outline-offset: 3px;
    border-radius: 50%;
}


/* Mobile improvements */

@media (max-width: 768px) {
    .star-rating {
        gap: 15px;
        padding: 20px;
    }
    .star {
        font-size: 36px;
        padding: 8px;
    }
    .modal-content {
        margin: 20% auto;
        padding: 30px 20px;
        width: 95%;
    }
    .modal-success-icon {
        font-size: 50px;
    }
}


/* Ensure stars work on touch devices */

@media (max-width: 480px) {
    .star {
        font-size: 40px;
        padding: 10px;
    }
    .star-rating {
        gap: 12px;
    }
}


/* Form validation improvements */

.form-input:invalid:not(:focus):not(:placeholder-shown),
.form-select:invalid:not(:focus),
.form-textarea:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #dc3545;
    background: #fff5f5;
}

.form-input:valid:not(:focus):not(:placeholder-shown),
.form-select:valid:not(:focus),
.form-textarea:valid:not(:focus):not(:placeholder-shown) {
    border-color: #28a745;
    background: #f5fff5;
}


/* Loading State */

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #b30000;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* Submit Button */

.submit-btn {
    background: linear-gradient(135deg, #b30000, #ff0000);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #990000, #cc0000);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(179, 0, 0, 0.3);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* Reviews List */

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.reviewer-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.review-date {
    color: #666;
    font-size: 14px;
}

.review-stars {
    color: #ffc107;
    margin-bottom: 10px;
}

.review-text {
    color: #555;
    line-height: 1.6;
}


/* Modal Styles */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-success-icon {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 20px;
}

.modal-title {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.modal-message {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-close-btn {
    background: #b30000;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.modal-close-btn:hover {
    background: #990000;
}


/* Responsive Form Styles */

@media (max-width: 768px) {
    .review-form {
        padding: 20px 15px;
        margin: 20px 0;
    }
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    .form-group.half {
        flex: none;
        width: 100%;
    }
    .form-input,
    .form-select,
    .form-textarea {
        padding: 10px 12px;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
    .star-rating {
        justify-content: center;
        gap: 8px;
    }
    .star {
        font-size: 28px;
        /* Larger touch targets */
    }
    .submit-btn {
        padding: 12px 20px;
        font-size: 16px;
    }
    /* Profile responsive */
    .profile-body {
        flex-direction: column;
        padding: 20px 15px;
    }
    .info-section {
        padding: 0 0 20px 0;
    }
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 15px;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    .gallery-item {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .review-form h3 {
        font-size: 1.3rem;
    }
    .profile-header {
        padding: 30px 15px;
    }
    .profile-avatar {
        width: 120px;
        height: 120px;
    }
    .instructor-name {
        font-size: 22px;
    }
    .instructor-title {
        font-size: 16px;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
}


/* Fix for review header */

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}


/* Better star rating for mobile */

@media (max-width: 768px) {
    .star-rating {
        flex-wrap: wrap;
        justify-content: center;
    }
    .star {
        margin: 0 2px;
    }
}


/* Loading state improvements */

.loading {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
}


/* Form validation styles */

.form-input:invalid,
.form-select:invalid,
.form-textarea:invalid {
    border-color: #dc3545;
}

.form-input:valid,
.form-select:valid,
.form-textarea:valid {
    border-color: #28a745;
}


/* Star rating validation feedback */

.star-rating:has(~ #ratingValue:invalid) {
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 5px;
}


/* Lightbox Modal */

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    max-height: 80%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
    z-index: 10000;
}

.lightbox-prev,
.lightbox-next {
    color: #f1f1f1;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}


/* Thêm hiệu ứng khi load ảnh */

.lightbox-content {
    animation: zoom 0.6s;
}

@keyframes zoom {
    from {
        transform: translate(-50%, -50%) scale(0)
    }
    to {
        transform: translate(-50%, -50%) scale(1)
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


/* Trên màn hình nhỏ hơn, ảnh chiếm 100% chiều rộng */

@media only screen and (max-width: 768px) {
    .lightbox-content {
        width: 95%;
    }
    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
    .lightbox-prev,
    .lightbox-next {
        font-size: 24px;
        width: 40px;
        height: 40px;
    }
    .lightbox-nav {
        padding: 0 10px;
    }
}


/* Trên màn hình rất nhỏ */

@media only screen and (max-width: 480px) {
    .lightbox-content {
        width: 98%;
    }
    .lightbox-close {
        top: 5px;
        right: 10px;
        font-size: 24px;
    }
    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        width: 35px;
        height: 35px;
    }
}


/* Thêm CSS cho trang danh sách giáo viên */

.teachers-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    text-align: center;
    color: #b30000;
    margin: 30px 0;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.teachers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.teacher-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid #f0f0f0;
}

.teacher-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(179, 0, 0, 0.15);
    border-color: #b30000;
}

.teacher-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.teacher-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.teacher-card:hover .teacher-image img {
    transform: scale(1.05);
}

.teacher-info {
    padding: 25px;
}

.teacher-name {
    color: #333;
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.teacher-exp {
    color: #666;
    font-size: 1rem;
    margin-bottom: 20px;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 20px;
    display: inline-block;
}

.teacher-exp i {
    color: #b30000;
    margin-right: 8px;
}

.detail-btn {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background: #b30000;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #b30000;
    margin-top: 20px;
}

.detail-btn:hover {
    background: white;
    color: #b30000;
}

.detail-btn i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.detail-btn:hover i {
    transform: translateX(5px);
}

.teacher-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-number {
    display: block;
    color: #b30000;
    font-weight: 700;
    font-size: 1.2rem;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-top: 5px;
}

.teacher-specialties {
    margin: 15px 0;
}

.specialty-tag {
    display: inline-block;
    background: #e8f4ff;
    color: #0066cc;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-right: 8px;
    margin-bottom: 8px;
}

.teacher-rating {
    color: #ffc107;
    margin: 10px 0;
}

@media (max-width: 768px) {
    .teachers-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    .page-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .teachers-grid {
        grid-template-columns: 1fr;
    }
    .page-title {
        font-size: 1.8rem;
    }
}