/* ============================================ */
/* COMPONENTS CSS
/* Reusable component classes from all CSS files
/* ============================================ */

/* ============================================ */
/* NAVIGATION TABS
/* ============================================ */

.nav-tabs {
    border: none;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.nav-tabs .nav-item {
    flex: 1;
    text-align: center;
    margin: 0;
    padding: 0;
    min-width: 0;
    position: relative;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 10px;
    margin: 0;
    padding: 0.75rem 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    color: #6c757d;
    background: var(--primary-alpha-10);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 48px;
    line-height: 1.2;
    word-break: keep-all;
    hyphens: none;
    font-size: 1rem;
}

.nav-tabs .nav-link::first-letter,
.nav-tabs .nav-link::first-line {
    font-size: inherit;
    line-height: inherit;
}

.nav-tabs .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-alpha-10);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-tabs .nav-link:hover {
    background: var(--primary-alpha-20);
    color: #495057;
    transform: translateY(-2px);
    border-color: var(--primary-alpha-30);
    box-shadow: 0 4px 15px var(--primary-alpha-20);
}

.nav-tabs .nav-link:hover::before {
    opacity: 1;
}

.nav-tabs .nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-primary-lg);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    z-index: 2;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    z-index: 3;
}

.nav-tabs .nav-link:hover:not(.active) {
    background: var(--primary-alpha-20);
    color: #495057;
    transform: translateY(-2px);
    border-color: var(--primary-alpha-30);
    box-shadow: 0 4px 15px var(--primary-alpha-20);
    z-index: 1;
}

/* Example Navigation Link (for pronunciation page) */
.example-nav-link {
    border: none;
    border-radius: 10px;
    margin: 0;
    padding: 0.75rem 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    color: #6c757d;
    background: var(--primary-alpha-10);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 48px;
    line-height: 1.2;
    word-break: keep-all;
    hyphens: none;
    font-size: 1rem;
    text-decoration: none;
}

.example-nav-link[data-example="4"] {
    font-size: 0.95rem;
    line-height: 1.3;
    word-break: break-word;
    hyphens: auto;
}

.example-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-alpha-10);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.example-nav-link:hover {
    background: var(--primary-alpha-20);
    color: #495057;
    transform: translateY(-2px);
    border-color: var(--primary-alpha-30);
    box-shadow: 0 4px 15px var(--primary-alpha-20);
    text-decoration: none;
}

.example-nav-link:hover::before {
    opacity: 1;
}

.example-nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-primary-lg);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    z-index: 2;
    text-decoration: none;
}

.example-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    z-index: 3;
}

/* ============================================ */
/* NAVIGATION PILLS
/* ============================================ */

.nav-pills {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
}

.nav-pills .nav-item {
    flex: 1;
    text-align: center;
    margin: 0;
    padding: 0;
}

.nav-pills .nav-link {
    border-radius: 10px;
    margin: 0;
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: #495057;
    background: var(--primary-alpha-5);
    border: 1px solid var(--primary-alpha-20);
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    display: block;
    box-sizing: border-box;
}

.nav-pills .nav-link:hover {
    background: var(--primary-alpha-15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-pills .nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-primary);
}

/* ============================================ */
/* CARD COMPONENTS
/* ============================================ */

/* Skill Cards */
.skill-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: none;
    transition: all 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.skill-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.skill-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
    color: white;
}

.skill-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* Modern Cards */
.modern-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-header-modern {
    background: #f7fafc;
    padding: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-body-modern {
    padding: 2rem;
}

/* Rule Cards (Grammar) */
.rule-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    margin-bottom: 2rem;
}

.rule-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.rule-header {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Question Cards */
.question-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.question-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.question-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    font-weight: bold;
    margin-right: 0.5rem;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Dashboard Card */
.dashboard-card {
    transition: all 0.3s ease;
}

/* Exercise Card */
.exercise-card {
    background: #fff;
    border: 2px solid #e3f2fd;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease;
}

.exercise-card:hover {
    border-color: var(--primary-color);
}

/* ============================================ */
/* BUTTON COMPONENTS
/* ============================================ */

.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-modern:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-edit {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-submit {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    min-width: fit-content;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: white;
    color: var(--primary-color);
}

.btn-back {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.back-button {
    background: var(--primary-lighter);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: transform 0.3s ease;
    margin-bottom: 2rem;
    text-decoration: none;
    display: inline-block;
}

.back-button:hover {
    transform: translateY(-2px);
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* ============================================ */
/* FORM COMPONENTS
/* ============================================ */

.form-check {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
}

.question-card .form-check {
    margin-left: 1rem;
}

.form-check:hover {
    background: var(--primary-alpha-5);
    border-color: var(--primary-alpha-20);
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.2rem;
    position: relative;
    z-index: 2;
}

.form-check-label {
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    padding-left: 0.5rem;
    position: relative;
    z-index: 2;
}

.form-check::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    cursor: pointer;
}

.form-group-modern {
    margin-bottom: 1.5rem;
}

.form-label-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.form-input-modern,
.form-select-modern {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.form-input-modern:focus,
.form-select-modern:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-alpha-10);
    background: white;
}

.form-hint {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* ============================================ */
/* AUDIO PLAYER COMPONENTS
/* ============================================ */

.audio-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #dee2e6;
}

.audio-section h5,
.audio-section h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.audio-section audio {
    width: 100%;
    border-radius: 10px;
}

/* ============================================ */
/* MODAL COMPONENTS
/* ============================================ */

.modal {
    z-index: 1055;
}

.modal-backdrop {
    z-index: 1050;
}

.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 2rem;
    border-radius: 20px 20px 0 0;
    background: #f7fafc;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 2rem;
    border-radius: 0 0 20px 20px;
    background: #f7fafc;
}

/* ============================================ */
/* BADGE COMPONENTS
/* ============================================ */

.tense-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.use-badge {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.profile-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--shadow-primary);
}

/* ============================================ */
/* EXAMPLE AND TEXT BOXES
/* ============================================ */

.example-box {
    background: var(--primary-lighter);
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

.french-example {
    color: var(--primary-color);
    font-weight: 600;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.vietnamese-translation {
    color: #666;
    font-size: 0.9rem;
}

.formula {
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
}

.highlight {
    background: #fff3cd;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* ============================================ */
/* CONJUGATION TABLES
/* ============================================ */

.conjugation-table {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.conjugation-table table {
    width: 100%;
    margin: 0;
}

.conjugation-table th {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    font-weight: 600;
    text-align: center;
}

.conjugation-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.conjugation-table tr:nth-child(even) {
    background-color: var(--primary-lighter);
}

/* ============================================ */
/* INFO GRID & ITEMS
/* ============================================ */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.info-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.info-content label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.info-content span {
    font-size: 1.1rem;
    color: #2d3748;
    font-weight: 500;
}

.header-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow-primary);
}

.header-content h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

.header-content p {
    margin: 0.25rem 0 0 0;
    color: #718096;
    font-size: 0.95rem;
}

/* ============================================ */
/* RESPONSIVE DESIGN FOR COMPONENTS
/* ============================================ */

@media (max-width: 768px) {
    .skill-card {
        padding: 1.5rem;
    }
    
    .nav-tabs {
        padding: 0.25rem;
        gap: 0.25rem;
        margin-bottom: 1.5rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .nav-tabs .nav-item {
        min-width: 0;
        flex: 1;
    }

    .form-actions {
        flex-direction: column;
    }
    
    .card-header-modern,
    .card-body-modern {
        padding: 1.5rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .btn-submit,
    .btn-back {
        width: 100%;
        max-width: 300px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        white-space: normal;
        text-align: center;
        line-height: 1.4;
    }

    .button-container {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .nav-tabs {
        padding: 0.2rem;
        gap: 0.2rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .nav-tabs .nav-link::after {
        display: none;
    }

    .btn-submit,
    .btn-back {
        max-width: 100%;
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
}

/* ============================================ */
/* AVATAR IMAGES
/* ============================================ */

/* Navbar Avatar */
.navbar-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.navbar-avatar-img:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Profile Page Avatar */
.profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.profile-avatar-img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Dashboard Avatar */
.dashboard-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.dashboard-avatar-img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-avatar-img {
        width: 28px;
        height: 28px;
        margin-right: 6px;
    }
    
    .profile-avatar-img {
        border-width: 3px;
    }
    
    .dashboard-avatar-img {
        border-width: 2px;
    }
}

