/**
 * AlAzharMessage Student Portal Styles.
 */

/* ==========================================================================
   Auth Pages (Login, Register, Forgot)
   ========================================================================== */
.alazhar-portal-auth-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, #3B0764 0%, #6B21A8 100%);
    position: relative;
    overflow: hidden;
}

.alazhar-portal-auth-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(234, 179, 8, 0.15), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(107, 33, 168, 0.2), transparent 40%);
    pointer-events: none;
}

.alazhar-portal-auth-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 2;
}

.alazhar-portal-auth-card {
    background: #fff;
    border-radius: 1.5rem;
    padding: 3rem 2.5rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    animation: portalFadeIn 0.4s ease-out;
}

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

.portal-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.portal-auth-icon {
    font-size: 3rem;
    color: #6B21A8;
    background: linear-gradient(135deg, #6B21A8, #EAB308);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    display: block;
}

.portal-auth-header h1 {
    color: #3B0764;
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
}

.portal-auth-header p {
    color: #6B7280;
    margin: 0;
}

.portal-auth-form {
    margin-top: 1.5rem;
}

.portal-form-group {
    margin-bottom: 1.25rem;
}

.portal-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #3B0764;
    font-size: 0.9375rem;
}

.portal-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.portal-input-wrapper {
    position: relative;
}

.portal-input-wrapper > i:first-child {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    pointer-events: none;
}

body.ltr-mode .portal-input-wrapper > i:first-child,
body.alazhar-lang-en .portal-input-wrapper > i:first-child {
    right: auto;
    left: 1rem;
}

.portal-input-wrapper input,
.portal-form-group input,
.portal-form-group select,
.portal-form-group textarea {
    width: 100%;
    padding: 0.875rem 2.75rem 0.875rem 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    background: #FFFBEB;
    transition: all 0.2s;
}

body.ltr-mode .portal-input-wrapper input,
body.alazhar-lang-en .portal-input-wrapper input {
    padding: 0.875rem 1rem 0.875rem 2.75rem;
}

.portal-form-group input:focus,
.portal-form-group select:focus,
.portal-form-group textarea:focus {
    outline: none;
    border-color: #6B21A8;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(107, 33, 168, 0.1);
}

.portal-toggle-password {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: #9CA3AF;
    cursor: pointer;
    padding: 0.5rem;
}

body.ltr-mode .portal-toggle-password,
body.alazhar-lang-en .portal-toggle-password {
    left: auto;
    right: 0.75rem;
}

.portal-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.portal-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: #4B5563;
}

.portal-checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: #6B21A8;
}

.portal-forgot-link {
    color: #6B21A8;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
}

.portal-forgot-link:hover {
    color: #EAB308;
}

.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: 0;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.portal-btn-primary {
    background: linear-gradient(135deg, #6B21A8, #035a30);
    color: #fff;
}

.portal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(107, 33, 168, 0.3);
    color: #fff;
}

.portal-btn-gold {
    background: linear-gradient(135deg, #EAB308, #B8941E);
    color: #3B0764;
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.3);
}

.portal-btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(234, 179, 8, 0.5);
    color: #3B0764;
}

.portal-btn-outline {
    background: transparent;
    color: #6B21A8;
    border: 2px solid #6B21A8;
}

.portal-btn-outline:hover {
    background: #6B21A8;
    color: #fff;
}

.portal-btn-danger {
    background: #EF4444;
    color: #fff;
}

.portal-btn-danger:hover {
    background: #DC2626;
    color: #fff;
}

.portal-btn-block {
    display: flex;
    width: 100%;
}

.portal-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.portal-alert {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.9375rem;
}

.portal-alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.portal-alert-success {
    background: #ECFDF5;
    color: #065F46;
    border-right: 4px solid #10B981;
}

body.ltr-mode .portal-alert-success,
body.alazhar-lang-en .portal-alert-success {
    border-right: 0;
    border-left: 4px solid #10B981;
}

.portal-alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border-right: 4px solid #EF4444;
}

body.ltr-mode .portal-alert-error,
body.alazhar-lang-en .portal-alert-error {
    border-right: 0;
    border-left: 4px solid #EF4444;
}

.portal-auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.portal-auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #E5E7EB;
}

.portal-auth-divider span {
    background: #fff;
    padding: 0 1rem;
    color: #9CA3AF;
    position: relative;
    font-size: 0.875rem;
}

.portal-auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.portal-auth-footer p {
    color: #6B7280;
    margin: 0 0 1rem;
}

.portal-auth-footer a {
    color: #6B21A8;
    font-weight: 600;
    text-decoration: none;
}

.portal-auth-help {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E5E7EB;
}

.portal-auth-help a {
    color: #6B7280;
    text-decoration: none;
    font-size: 0.9375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-auth-help a:hover {
    color: #25D366;
}

/* ==========================================================================
   Portal Layout (Dashboard, Profile, etc.)
   ========================================================================== */
.alazhar-portal-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 100px);
    background: #FFFBEB;
}

.alazhar-portal-sidebar {
    background: #fff;
    border-left: 1px solid #E5E7EB;
    padding: 2rem 1rem;
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

body.ltr-mode .alazhar-portal-sidebar,
body.alazhar-lang-en .alazhar-portal-sidebar {
    border-left: 0;
    border-right: 1px solid #E5E7EB;
}

.portal-sidebar-user {
    text-align: center;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #6B21A8, #3B0764);
    color: #fff;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}

.portal-sidebar-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #EAB308;
    margin-bottom: 0.75rem;
}

.portal-sidebar-user h3 {
    margin: 0 0 0.25rem;
    color: #fff;
    font-size: 1.125rem;
}

.portal-sidebar-user p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
    word-break: break-all;
}

.portal-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.portal-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #4B5563;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.portal-nav-item:hover {
    background: #F3F4F6;
    color: #6B21A8;
}

.portal-nav-item.active {
    background: linear-gradient(90deg, rgba(107, 33, 168, 0.1), transparent);
    color: #6B21A8;
    font-weight: 600;
    border-right: 3px solid #6B21A8;
}

body.ltr-mode .portal-nav-item.active,
body.alazhar-lang-en .portal-nav-item.active {
    border-right: 0;
    border-left: 3px solid #6B21A8;
    background: linear-gradient(-90deg, rgba(107, 33, 168, 0.1), transparent);
}

.portal-nav-item i {
    width: 20px;
    text-align: center;
    color: #9CA3AF;
}

.portal-nav-item.active i,
.portal-nav-item:hover i {
    color: #6B21A8;
}

.portal-nav-badge {
    background: #EF4444;
    color: #fff;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: auto;
    margin-left: 0.5rem;
}

.portal-nav-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 0.5rem 0;
}

.portal-nav-logout {
    color: #EF4444 !important;
    margin-top: 0.5rem;
}

.portal-nav-logout:hover {
    background: #FEF2F2 !important;
    color: #DC2626 !important;
}

.portal-sidebar-toggle {
    display: none;
    position: fixed;
    top: 100px;
    right: 1rem;
    z-index: 100;
    background: #6B21A8;
    color: #fff;
    border: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
}

/* Main content */
.alazhar-portal-main {
    padding: 2rem;
    max-width: 100%;
    overflow-x: hidden;
}

.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.portal-header h1 {
    color: #3B0764;
    margin: 0;
    font-size: 1.75rem;
}

.portal-header h1 i {
    color: #6B21A8;
    margin-left: 0.5rem;
}

.portal-subtitle {
    color: #6B7280;
    margin: 0.25rem 0 0;
    font-size: 0.9375rem;
}

/* Welcome banner */
.portal-welcome-banner {
    background: linear-gradient(135deg, #EAB308, #B8941E);
    color: #3B0764;
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.welcome-content h2 {
    color: #3B0764;
    margin: 0 0 0.5rem;
}

.welcome-content p {
    margin: 0;
}

.close-welcome {
    background: rgba(0,0,0,0.1);
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    color: #3B0764;
    flex-shrink: 0;
}

/* Stats cards */
.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.portal-stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 1rem;
    border-right: 4px solid #6B21A8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

body.ltr-mode .portal-stat-card,
body.alazhar-lang-en .portal-stat-card {
    border-right: 0;
    border-left: 4px solid #6B21A8;
}

.portal-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-content h3 {
    font-size: 2rem;
    color: #3B0764;
    margin: 0;
    line-height: 1;
}

.unread-badge {
    background: #EF4444;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.stat-content p {
    color: #6B7280;
    margin: 0.25rem 0 1rem;
    font-size: 0.9375rem;
}

.stat-link {
    color: #6B21A8;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
}

.stat-link:hover {
    color: #EAB308;
}

/* Progress bar */
.portal-progress-section {
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.section-header h2 {
    margin: 0;
    color: #3B0764;
    font-size: 1.25rem;
}

.section-header h2 i {
    color: #6B21A8;
}

.progress-percent {
    color: #6B21A8;
    font-size: 1.5rem;
    font-weight: 800;
}

.progress-bar-wrapper {
    background: #E5E7EB;
    height: 12px;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    background: linear-gradient(90deg, #6B21A8, #EAB308);
    height: 100%;
    border-radius: 9999px;
    transition: width 1s ease-out;
}

.progress-note {
    color: #6B7280;
    margin: 0;
    text-align: center;
    font-size: 0.9375rem;
}

/* Two column layout */
.portal-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.portal-full-width {
    grid-column: 1 / -1;
}

/* Widget */
.portal-widget {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.widget-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-header h2 {
    margin: 0;
    color: #3B0764;
    font-size: 1.125rem;
}

.widget-header h2 i {
    color: #6B21A8;
    margin-left: 0.5rem;
}

.widget-view-all {
    color: #6B21A8;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
}

.widget-empty {
    padding: 3rem 2rem;
    text-align: center;
    color: #9CA3AF;
}

.widget-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: #E5E7EB;
}

/* Message items */
.portal-messages-list .message-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #F3F4F6;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    position: relative;
    align-items: flex-start;
}

.portal-messages-list .message-item:last-child {
    border-bottom: 0;
}

.portal-messages-list .message-item:hover {
    background: #FFFBEB;
}

.portal-messages-list .message-item.unread {
    background: #F0FDF4;
}

.portal-messages-list .message-item img {
    border-radius: 50%;
    flex-shrink: 0;
}

.msg-avatar {
    width: 40px;
    height: 40px;
    background: #E5E7EB;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    flex-shrink: 0;
}

.msg-content {
    flex: 1;
    min-width: 0;
}

.msg-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.msg-header strong {
    color: #3B0764;
}

.msg-time {
    color: #9CA3AF;
    font-size: 0.75rem;
    white-space: nowrap;
}

.msg-title {
    font-weight: 600;
    color: #3B0764;
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.msg-preview {
    color: #6B7280;
    font-size: 0.875rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.msg-unread-dot {
    width: 10px;
    height: 10px;
    background: #6B21A8;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.5rem;
}

/* Certificate cards */
.portal-certs-list {
    padding: 0.5rem;
}

.cert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #FFF8E1, #fff);
    margin-bottom: 0.5rem;
    border: 1px solid #FEF3C7;
}

.cert-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.cert-info {
    flex: 1;
}

.cert-info strong {
    display: block;
    color: #3B0764;
    margin-bottom: 0.125rem;
}

.cert-date {
    color: #6B7280;
    font-size: 0.8125rem;
}

.cert-download {
    color: #EAB308;
    background: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.cert-download:hover {
    background: #EAB308;
    color: #fff;
    transform: scale(1.1);
}

/* Teachers grid */
.teachers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.teacher-card {
    text-align: center;
    padding: 1.5rem;
    background: #FFFBEB;
    border-radius: 1rem;
    border: 1px solid #E5E7EB;
    transition: all 0.3s;
}

.teacher-card:hover {
    transform: translateY(-4px);
    border-color: #EAB308;
}

.teacher-avatar {
    border-radius: 50%;
    margin: 0 auto 1rem;
    border: 3px solid #EAB308;
}

.teacher-card h4 {
    color: #3B0764;
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.teacher-card p {
    color: #6B7280;
    font-size: 0.8125rem;
    margin: 0 0 1rem;
}

.teacher-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Profile page */
.portal-profile-header {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

.profile-large-avatar {
    border-radius: 50%;
    border: 4px solid #EAB308;
}

.profile-avatar-hint {
    text-align: center;
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
}

.profile-avatar-hint a {
    color: #6B21A8;
    text-decoration: none;
}

.profile-info-section h2 {
    color: #3B0764;
    margin: 0 0 0.25rem;
}

.profile-email {
    color: #6B7280;
    margin: 0 0 1rem;
}

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

.profile-badge {
    background: #F3F4F6;
    color: #3B0764;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.profile-badge i {
    color: #6B21A8;
}

.portal-form {
    padding: 1.5rem;
}

.portal-form-hint {
    color: #9CA3AF;
    font-size: 0.8125rem;
    display: block;
    margin-top: 0.25rem;
}

.portal-logout-section {
    padding: 1.5rem;
}

.portal-logout-section h3 {
    color: #3B0764;
    margin: 1rem 0;
    font-size: 1rem;
}

.portal-logout-section hr {
    border: 0;
    border-top: 1px solid #E5E7EB;
    margin: 0;
}

/* Empty state */
.portal-empty-state {
    background: #fff;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.portal-empty-state .empty-icon {
    display: inline-flex;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #FFF8E1, #FEF3C7);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #EAB308;
    margin-bottom: 1.5rem;
}

.portal-empty-state h2,
.portal-empty-state h3 {
    color: #3B0764;
    margin: 0 0 0.75rem;
}

.portal-empty-state p {
    color: #6B7280;
    max-width: 480px;
    margin: 0 auto 1.5rem;
}

.portal-empty-state i {
    color: #E5E7EB;
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

/* Certificates Grid */
.portal-certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.cert-card {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.cert-card:hover {
    transform: translateY(-4px);
    border-color: #EAB308;
    box-shadow: 0 12px 32px rgba(234, 179, 8, 0.2);
}

.cert-card-decor {
    background: linear-gradient(135deg, #6B21A8, #3B0764);
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cert-card-decor::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(234, 179, 8, 0.3), transparent 70%);
}

.cert-ribbon {
    position: absolute;
    top: 1rem;
    right: -20px;
    background: #EAB308;
    color: #3B0764;
    padding: 0.25rem 2rem;
    transform: rotate(45deg);
    font-size: 0.75rem;
    font-weight: 700;
}

.cert-card-icon {
    font-size: 4rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    position: relative;
    z-index: 2;
}

.cert-card-content {
    padding: 1.5rem;
}

.cert-card-content h3 {
    color: #3B0764;
    margin: 0 0 0.75rem;
    font-size: 1.125rem;
}

.cert-type-badge {
    display: inline-block;
    background: #F0FDF4;
    color: #6B21A8;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.cert-issue-date {
    color: #6B7280;
    font-size: 0.875rem;
    margin: 0 0 1rem;
}

.cert-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Certificate Viewer */
.portal-certificate-viewer {
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.certificate-print-preview {
    background: linear-gradient(135deg, #FFFBEB, #fff);
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.certificate-design {
    background: #fff;
    padding: 3rem 2rem;
    border: 3px double #EAB308;
    border-radius: 8px;
    position: relative;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.cert-border-decor {
    position: absolute;
    inset: 8px;
    border: 1px solid #EAB308;
    border-radius: 4px;
    pointer-events: none;
}

.cert-inner {
    position: relative;
    z-index: 2;
}

.cert-logo {
    font-size: 3rem;
    color: #6B21A8;
    margin-bottom: 1rem;
}

.cert-title {
    font-size: 2rem;
    color: #3B0764;
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.cert-subtitle {
    color: #6B7280;
    font-style: italic;
    margin: 0 0 1.5rem;
}

.cert-recipient {
    font-size: 2.5rem;
    color: #EAB308;
    margin: 0 0 1rem;
    font-family: 'Playfair Display', Georgia, serif;
    border-bottom: 2px solid #EAB308;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.cert-description {
    color: #4B5563;
    margin: 1rem 0 0.5rem;
}

.cert-course {
    color: #6B21A8;
    font-size: 1.5rem;
    margin: 0.5rem 0 2rem;
}

.cert-body-text {
    color: #6B7280;
    max-width: 500px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.cert-signatures {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    max-width: 600px;
    margin: 2rem auto 0;
}

.cert-sig {
    text-align: center;
    flex: 1;
}

.cert-sig p {
    font-weight: 700;
    color: #3B0764;
    margin: 0;
    border-bottom: 1px solid #6B7280;
    padding-bottom: 0.5rem;
    padding-top: 1rem;
}

.cert-sig span {
    color: #6B7280;
    font-size: 0.875rem;
    display: block;
    margin-top: 0.5rem;
}

.cert-seal {
    font-size: 4rem;
    color: #EAB308;
    filter: drop-shadow(0 4px 8px rgba(234, 179, 8, 0.3));
}

.cert-number {
    margin-top: 1.5rem;
    color: #9CA3AF;
    font-size: 0.75rem;
    letter-spacing: 2px;
}

.certificate-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Messages Tabs */
.portal-messages-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #E5E7EB;
}

.portal-tab {
    background: transparent;
    border: 0;
    padding: 0.75rem 1.25rem;
    color: #6B7280;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.9375rem;
}

.portal-tab.active {
    color: #6B21A8;
    border-bottom-color: #6B21A8;
}

.tab-count {
    background: #E5E7EB;
    color: #6B7280;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.portal-tab.active .tab-count {
    background: #6B21A8;
    color: #fff;
}

.portal-tab-content {
    display: none;
}

.portal-tab-content.active {
    display: block;
}

/* Message View */
.portal-message-view {
    padding: 1.5rem;
}

.msg-view-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E5E7EB;
}

.msg-back-link {
    color: #6B21A8;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.msg-view-header h2 {
    color: #3B0764;
    margin: 0;
    font-size: 1.5rem;
}

.msg-view-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #FFFBEB;
    border-radius: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.msg-participant {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.msg-participant img {
    border-radius: 50%;
}

.msg-participant strong {
    display: block;
    color: #3B0764;
}

.msg-participant span {
    color: #6B7280;
    font-size: 0.8125rem;
}

.msg-timestamp {
    color: #9CA3AF;
    font-size: 0.875rem;
}

.msg-view-body {
    color: #1A1A1A;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.msg-view-actions {
    padding-top: 1rem;
    border-top: 1px solid #E5E7EB;
}

/* Progress overview */
.portal-progress-overview {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.progress-big-card {
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.progress-big-card h2 {
    color: #3B0764;
    margin: 0 0 1.5rem;
    font-size: 1.125rem;
}

.progress-circle-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.progress-circle {
    width: 100%;
    height: 100%;
    transform: rotate(0deg);
}

.progress-circle-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-percent-big {
    font-size: 3rem;
    font-weight: 800;
    color: #6B21A8;
    line-height: 1;
}

.progress-label {
    color: #6B7280;
    font-size: 0.9375rem;
    margin-top: 0.5rem;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.progress-stat {
    background: #fff;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-stat i {
    font-size: 2rem;
    color: #EAB308;
    background: #FFF8E1;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-stat h3 {
    color: #3B0764;
    margin: 0;
    font-size: 1.5rem;
    line-height: 1;
}

.progress-stat p {
    color: #6B7280;
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
}

.portal-reports-list {
    padding: 1rem;
}

.report-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #FFFBEB;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #E5E7EB;
}

.report-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6B21A8, #EAB308);
    color: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.report-content {
    flex: 1;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.report-header h3 {
    color: #3B0764;
    margin: 0;
    font-size: 1.125rem;
}

.report-date {
    color: #9CA3AF;
    font-size: 0.875rem;
    white-space: nowrap;
}

.report-teacher {
    color: #6B7280;
    font-size: 0.875rem;
    margin: 0 0 0.5rem;
}

.report-rating {
    color: #EAB308;
    margin-bottom: 0.75rem;
}

.report-body {
    color: #4B5563;
    line-height: 1.7;
}

/* Portal in header */
.alazhar-portal-menu {
    display: inline-flex;
    align-items: center;
}

.portal-user-btn,
.portal-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #F3F4F6;
    color: #3B0764;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    position: relative;
}

.portal-user-btn:hover,
.portal-login-btn:hover {
    background: #6B21A8;
    color: #fff;
}

.portal-user-avatar {
    border-radius: 50%;
    width: 28px;
    height: 28px;
}

.portal-badge {
    background: #EF4444;
    color: #fff;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    position: absolute;
    top: -4px;
    left: -4px;
}

/* Responsive */
@media (max-width: 1024px) {
    .alazhar-portal-wrapper {
        grid-template-columns: 1fr;
    }

    .alazhar-portal-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        z-index: 999;
        transition: right 0.3s;
        border: 0;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    }

    .alazhar-portal-sidebar.open {
        right: 0;
    }

    body.ltr-mode .alazhar-portal-sidebar,
    body.alazhar-lang-en .alazhar-portal-sidebar {
        right: auto;
        left: -100%;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    }

    body.ltr-mode .alazhar-portal-sidebar.open,
    body.alazhar-lang-en .alazhar-portal-sidebar.open {
        left: 0;
    }

    .portal-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .portal-two-columns {
        grid-template-columns: 1fr;
    }

    .portal-progress-overview {
        grid-template-columns: 1fr;
    }

    .progress-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .alazhar-portal-main {
        padding: 1rem;
    }

    .portal-form-row-2 {
        grid-template-columns: 1fr;
    }

    .portal-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .certificate-design {
        padding: 2rem 1rem;
    }

    .cert-title {
        font-size: 1.25rem;
    }

    .cert-recipient {
        font-size: 1.5rem;
    }

    .cert-signatures {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* Print styles for certificates */
@media print {
    .alazhar-portal-sidebar,
    .portal-header,
    .certificate-actions,
    .site-header,
    .site-footer,
    .alazhar-floating-whatsapp,
    .alazhar-back-to-top,
    .portal-sidebar-toggle,
    .msg-back-link {
        display: none !important;
    }

    .alazhar-portal-wrapper {
        grid-template-columns: 1fr;
    }

    .alazhar-portal-main {
        padding: 0;
    }

    .certificate-design {
        border: 3px double #EAB308 !important;
        page-break-inside: avoid;
    }
}
