/* Class Subject Custom Styles */

:root {
    --primary-blue: #2172ED;
    --light-bg: #F8F9FA;
    --card-border: #E9ECEF;
    --text-muted: #6C757D;
    --success-green: #28A745;
    --danger-red: #DC3545;
    --badge-year-bg: #E7F6E7;
    --badge-year-text: #2D5A27;
    --badge-sem-bg: #E8F2FF;
    --badge-sem-text: #2172ED;
    --group-bg: #F1F3F4;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0;
}

.header-badges {
    display: flex;
    gap: 0.75rem;
}

.main-card {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    overflow: hidden;
}

.card-header-info {
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    background-color: #fff;
    border-radius: 12px 12px 0 0;
}

.class-info-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem 2rem;
    background-color: #fff;
}

.info-block {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-icon-wrap {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.info-icon-wrap.bg-light-blue {
    background-color: #EEF4FF;
    color: var(--primary-blue);
}

.info-icon-wrap.bg-light-green {
    background-color: #E7F6E7;
    color: var(--success-green);
}

.info-icon-wrap.bg-light-red {
    background-color: #FEF0F0;
    color: var(--danger-red);
}

.info-text-wrap {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8A92A6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.info-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #232D42;
}

.info-divider {
    width: 1px;
    height: 40px;
    background-color: #E9ECEF;
    margin: 0 2rem;
}

@media (max-width: 768px) {
    .class-info-box {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        max-width: 100%;
        gap: 1rem;
        padding: 1.25rem;
    }

    .info-divider {
        width: 100%;
        height: 1px;
        margin: 0.5rem 0;
    }

    .elective-subject {
        flex-direction: column !important;
    }

    .elective-option-card {
        width: 100%;
    }

    .or-divider {
        margin: 1rem auto !important;
    }
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.section-title i {
    color: var(--primary-blue);
    font-size: 0.9rem;
}

/* Core Subjects Styles */
.core-subject-row {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.core-subject-row:hover {
    background-color: var(--light-bg);
}

.btn-remove-row {
    background: none;
    border: none;
    color: var(--danger-red);
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-remove-row:hover {
    transform: scale(1.1);
}

.btn-add-outline {
    border: 2px dashed var(--primary-blue);
    background: transparent;
    color: var(--primary-blue);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-add-outline:hover {
    background-color: rgba(33, 114, 237, 0.05);
    border-color: var(--primary-blue);
}

/* Elective Subjects Styles */
.elective-group-card {
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    background-color: #fff;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.group-badge {
    background-color: var(--group-bg);
    color: #555;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.option-container {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    flex-wrap: wrap;
}

.elective-option-card {
    background-color: var(--group-bg);
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 1.25rem;
    flex: 1;
    min-width: 250px;
    position: relative;
    margin-bottom: 1rem;
}

.or-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #888;
    z-index: 1;
    margin: auto 0;
    align-self: center;
    flex-shrink: 0;
}

.add-option-box {
    border: 2px dashed #CBD5E0;
    border-radius: 8px;
    background-color: var(--light-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 1rem;
    cursor: pointer;
    color: #718096;
    transition: all 0.2s;
    flex: 1;
    margin-bottom: 1rem;
}

.add-option-box:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.add-option-box i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.form-control-custom {
    border-radius: 6px;
    border: 1px solid #D1D5DB;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}

.form-control-custom:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(33, 114, 237, 0.1);
}

.form-group {
    position: relative;
    padding-bottom: 1.25rem;
    /* Reserve space for error message */
    margin-bottom: 0.5rem;
}

.label-custom {
    font-weight: 600;
    font-size: 0.85rem;
    color: #4B5563;
    margin-bottom: 0.4rem;
    display: block;
}

/* Validation Error Styling */
label.error,
.text-danger.mt-2 {
    position: absolute;
    bottom: 0;
    left: 0;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0 !important;
    line-height: 1;
}

.btn-save {
    background-color: var(--primary-blue);
    border: none;
    color: #fff;
    padding: 0.75rem 2.5rem;
    border-radius: 6px;
    font-weight: 700;
    transition: background-color 0.2s;
}

.btn-save:hover {
    background-color: #1a62d4;
}

/* Responsiveness */
@media (max-width: 768px) {
    .option-container {
        flex-direction: column;
    }

    .or-divider {
        height: auto;
        padding: 0.5rem 0;
        border-radius: 4px;
        margin: 0.5rem 0;
    }
}