/* قسم أكواد الكورسات في الملف الشخصي */

.course-codes-intro {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.08) 0%, rgba(255, 159, 67, 0.06) 100%);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.course-codes-intro-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4a90e2 0%, #3a7bc8 100%);
    color: white;
    border-radius: 12px;
    font-size: 1.5rem;
}

.course-codes-intro-text {
    margin: 0;
    color: #2c3e50;
    font-size: 0.95rem;
    line-height: 1.7;
}

.course-codes-container {
    min-height: 120px;
    position: relative;
}

.course-codes-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: #8b95a5;
}

.course-codes-loading.hidden {
    display: none;
}

.course-codes-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(74, 144, 226, 0.2);
    border-top-color: #4a90e2;
    border-radius: 50%;
    animation: course-codes-spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes course-codes-spin {
    to { transform: rotate(360deg); }
}

.course-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.course-code-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid rgba(74, 144, 226, 0.25);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26, 35, 50, 0.06);
}

.course-code-card:hover {
    border-color: #4a90e2;
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.15);
    transform: translateY(-2px);
}

.course-code-card.copied {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.course-code-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #1a2332 0%, #243447 100%);
}

.course-code-card-cover {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.course-code-card-cover-placeholder {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 8px;
    background: rgba(74, 144, 226, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
}

.course-code-card-title {
    flex: 1;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.4;
}

.course-code-card-body {
    padding: 1.25rem 1.25rem 1.5rem;
}

.course-code-label {
    font-size: 0.75rem;
    color: #8b95a5;
    margin-bottom: 0.5rem;
    display: block;
}

.course-code-value {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #1a2332;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.08) 0%, rgba(255, 159, 67, 0.06) 100%);
    border: 1px dashed rgba(74, 144, 226, 0.4);
    border-radius: 10px;
    direction: ltr;
    text-align: center;
    transition: all 0.2s ease;
}

.course-code-card:hover .course-code-value {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.12) 0%, rgba(255, 159, 67, 0.08) 100%);
    border-color: #4a90e2;
}

.course-code-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(74, 144, 226, 0.05);
    color: #4a90e2;
    font-size: 0.8rem;
}

.course-code-card-footer i {
    font-size: 1rem;
}

.course-codes-empty {
    text-align: center;
    padding: 3rem 2rem;
}

.course-codes-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 50%;
    color: #4a90e2;
    font-size: 2.5rem;
}

.course-codes-empty h4 {
    margin: 0 0 0.5rem;
    color: #2c3e50;
    font-size: 1.15rem;
}

.course-codes-empty p {
    margin: 0;
    color: #8b95a5;
    font-size: 0.95rem;
}

.btn-retry-codes {
    margin-top: 1rem;
    padding: 0.6rem 1.25rem;
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s ease;
}

.btn-retry-codes:hover {
    background: #3a7bc8;
}

@media (max-width: 768px) {
    .course-codes-grid {
        grid-template-columns: 1fr;
    }

    .course-code-value {
        font-size: 1.1rem;
    }
}

/* قسم أكواد الخصم المستخدمة في الملف الشخصي */
.profile-subtitle {
    color: #8b95a5;
    font-size: 0.95rem;
    margin: -0.5rem 0 1.25rem 0;
}

.discount-codes-container {
    min-height: 120px;
}

.discount-codes-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #8b95a5;
    gap: 0.75rem;
}

.discount-codes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.discount-code-used-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid rgba(74, 144, 226, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: box-shadow 0.2s;
}

.discount-code-used-card:hover {
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.discount-code-used-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.discount-code-used-code {
    font-family: monospace;
    font-weight: 700;
    font-size: 1.05rem;
    color: #1a2332;
    letter-spacing: 0.5px;
}

.discount-code-used-amount {
    font-weight: 700;
    color: #4CAF50;
    font-size: 1rem;
}

.discount-code-used-body {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #8b95a5;
}

.discount-code-used-course {
    color: #2c3e50;
    font-weight: 500;
}
