/**
 * Modern Social Auth - Public Styles
 * Clean, minimal, and responsive design with RTL support
 */

/* ===========================
   Variables & Reset
   =========================== */
:root {
	--msa-primary: #4f46e5;
	--msa-primary-hover: #4338ca;
	--msa-text: #1a1a1a;
	--msa-text-light: #6b7280;
	--msa-border: #d1d5db;
	--msa-bg: #ffffff;
	--msa-bg-disabled: #f3f4f6;
	--msa-danger: #ef4444;
	--msa-success: #10b981;
	--msa-radius: 8px;
	--msa-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.msa-profile-container,
.msa-login-container {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.msa-profile-container *,
.msa-login-container * {
	box-sizing: border-box;
}

/* ===========================
   Containers
   =========================== */
.msa-login-container {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 400px;
	padding: 20px;
}

.msa-profile-container {
	display: flex;
	justify-content: center;
	padding: 40px 20px;
	background-color: #f9fafb;
}

.msa-login-form,
.msa-profile-form {
	width: 100%;
	background: var(--msa-bg);
	border-radius: 12px;
	box-shadow: var(--msa-shadow);
	padding: 40px;
}

.msa-login-form {
	max-width: 400px;
}

.msa-profile-form {
	max-width: 800px;
}

/* ===========================
   Typography
   =========================== */
.msa-profile-title,
.msa-login-title {
	margin: 0 0 24px 0;
	font-size: 24px;
	font-weight: 700;
	color: var(--msa-text);
	text-align: center;
}

.msa-section-title {
	font-size: 18px;
	font-weight: 600;
	color: var(--msa-text);
	margin: 0 0 20px 0;
	padding-bottom: 10px;
	border-bottom: 1px solid #e5e7eb;
}

.msa-profile-description {
	margin: 0 0 30px 0;
	font-size: 14px;
	color: var(--msa-text-light);
	text-align: center;
	line-height: 1.5;
}

/* ===========================
   Tabs
   =========================== */
.msa-tabs {
	display: flex;
	border-bottom: 2px solid #e5e7eb;
	margin-bottom: 30px;
}

.msa-tab-link {
	padding: 12px 24px;
	font-weight: 600;
	color: var(--msa-text-light);
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: all 0.2s ease;
}

.msa-tab-link:hover {
	color: var(--msa-primary);
}

.msa-tab-link.active {
	color: var(--msa-primary);
	border-bottom-color: var(--msa-primary);
}

.msa-tab-content {
	display: none;
	animation: fadeIn 0.3s ease;
}

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

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

/* ===========================
   Profile Picture Upload
   =========================== */
.msa-profile-picture-wrapper {
	text-align: center;
	margin-bottom: 30px;
	position: relative;
	width: 120px;
	height: 120px;
	margin-left: auto;
	margin-right: auto;
}

.msa-profile-picture-img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	border: 4px solid white;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.msa-profile-picture-upload-btn {
	position: absolute;
	bottom: 0;
	right: 0;
	background: var(--msa-primary);
	color: white;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.msa-profile-picture-upload-btn:hover {
	background: var(--msa-primary-hover);
	transform: scale(1.1);
}

.msa-profile-picture-upload-btn svg {
	width: 16px;
	height: 16px;
}

.msa-hidden-file-input {
	display: none;
}

/* ===========================
   Layout & Grid
   =========================== */
.msa-form-section {
	margin-bottom: 30px;
}

.msa-form-separator {
	height: 1px;
	background-color: #e5e7eb;
	margin: 30px 0;
}

.msa-grid-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

@media (min-width: 640px) {
	.msa-grid-row {
		grid-template-columns: 1fr 1fr;
	}
	
	.msa-full-width {
		grid-column: 1 / -1;
	}
}

/* ===========================
   Form Elements
   =========================== */
.msa-form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.msa-form-label {
	font-size: 14px;
	font-weight: 500;
	color: #374151;
}

.msa-input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.msa-form-input,
.msa-form-select {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--msa-border);
	border-radius: var(--msa-radius);
	font-size: 15px;
	color: var(--msa-text);
	background: var(--msa-bg);
	transition: all 0.2s ease;
	outline: none;
}

.msa-form-input:focus,
.msa-form-select:focus {
	border-color: var(--msa-primary);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.msa-form-input.msa-disabled {
	background-color: var(--msa-bg-disabled);
	color: #6b7280;
	cursor: not-allowed;
	padding-right: 40px; /* Space for lock icon */
}

/* RTL Support for Input Padding */
[dir="rtl"] .msa-form-input.msa-disabled {
	padding-right: 14px;
	padding-left: 40px;
}

.msa-lock-icon {
	position: absolute;
	right: 12px;
	color: #9ca3af;
	display: flex;
	align-items: center;
	pointer-events: none;
}

[dir="rtl"] .msa-lock-icon {
	right: auto;
	left: 12px;
}

.msa-form-help {
	font-size: 12px;
	color: var(--msa-text-light);
	margin: 2px 0 0 0;
}

/* ===========================
   Buttons
   =========================== */
.msa-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	border-radius: var(--msa-radius);
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	border: 1px solid transparent;
	text-decoration: none;
}

.msa-btn-sm {
	padding: 8px 16px;
	font-size: 13px;
}

.msa-btn-primary {
	background-color: var(--msa-primary);
	color: white;
	width: 100%;
}

.msa-btn-primary:hover {
	background-color: var(--msa-primary-hover);
}

.msa-btn-primary:disabled {
	opacity: 0.7;
	cursor: wait;
}

.msa-btn-outline {
	background-color: transparent;
	border: 1px solid var(--msa-border);
	color: var(--msa-text);
}

.msa-btn-outline:hover {
	background-color: #f9fafb;
	border-color: #9ca3af;
}

/* Social Buttons */
.msa-social-buttons {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.msa-btn-google,
.msa-btn-linkedin {
	background: white;
	border-color: var(--msa-border);
	color: var(--msa-text);
	width: 100%;
}

.msa-btn-google:hover,
.msa-btn-linkedin:hover {
	background-color: #f9fafb;
	border-color: #9ca3af;
}

.msa-btn-icon {
	width: 20px;
	height: 20px;
	margin-right: 12px;
}

[dir="rtl"] .msa-btn-icon {
	margin-right: 0;
	margin-left: 12px;
}

/* ===========================
   Messages
   =========================== */
.msa-form-message {
	margin-top: 20px;
	padding: 12px;
	border-radius: var(--msa-radius);
	font-size: 14px;
	text-align: center;
}

.msa-form-message.success {
	background-color: #d1fae5;
	color: #065f46;
}

.msa-form-message.error {
	background-color: #fee2e2;
	color: #991b1b;
}

.msa-alert {
	padding: 12px 16px;
	border-radius: var(--msa-radius);
	margin-bottom: 24px;
	font-size: 14px;
	line-height: 1.5;
}

.msa-alert-success {
	background-color: #d1fae5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.msa-alert-warning {
	background-color: #fffbeb;
	color: #92400e;
	border: 1px solid #fde68a;
}

.msa-alert-danger {
	background-color: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.msa-alert-info {
	background-color: #eff6ff;
	color: #1e40af;
	border: 1px solid #bfdbfe;
}

/* ===========================
   My Courses
   =========================== */
.msa-courses-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Reduced from 240px */
	gap: 20px;
}

.msa-course-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--msa-border);
	border-radius: var(--msa-radius);
	overflow: hidden;
	text-decoration: none;
	transition: all 0.2s ease;
	color: var(--msa-text);
}

.msa-course-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--msa-shadow);
	border-color: var(--msa-primary);
}

.msa-course-image {
	height: 120px; /* Reduced from 140px */
	background-color: #f3f4f6;
	overflow: hidden;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.msa-course-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.msa-course-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #9ca3af;
}

.msa-course-placeholder svg {
	width: 40px; /* Reduced from 48px */
	height: 40px;
}

.msa-course-content {
	padding: 16px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.msa-course-title {
	margin: 0 0 12px 0;
	font-size: 15px; /* Reduced from 16px */
	font-weight: 600;
	line-height: 1.4;
	color: var(--msa-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.msa-course-progress {
	margin-top: auto;
}

.msa-progress-bar {
	height: 6px;
	background-color: #e5e7eb;
	border-radius: 3px;
	overflow: hidden;
	margin-bottom: 6px;
}

.msa-progress-fill {
	height: 100%;
	background-color: var(--msa-success);
	border-radius: 3px;
	transition: width 0.3s ease;
}

.msa-progress-text {
	font-size: 12px;
	color: var(--msa-text-light);
	font-weight: 500;
}

/* ===========================
   Certificates
   =========================== */
.msa-certificates-list {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.msa-certificate-item {
	display: flex;
	align-items: center;
	padding: 20px;
	background: #fff;
	border: 1px solid var(--msa-border);
	border-radius: var(--msa-radius);
	transition: all 0.2s ease;
}

.msa-certificate-item:hover {
	transform: translateY(-2px);
	box-shadow: var(--msa-shadow);
	border-color: var(--msa-primary);
}

.msa-cert-icon {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	background-color: #eff6ff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 20px;
	color: var(--msa-primary);
}

.msa-cert-details {
	flex: 1;
	margin-right: 20px;
}

.msa-cert-title {
	margin: 0 0 5px 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--msa-text);
}

.msa-cert-date {
	font-size: 13px;
	color: var(--msa-text-light);
}

.msa-certificate-item .msa-btn svg {
	margin-right: 8px;
}

.msa-no-content {
	text-align: center;
	padding: 40px 20px;
	color: var(--msa-text-light);
}

.msa-no-content-icon {
	margin-bottom: 15px;
	color: #d1d5db;
}

/* RTL Overrides */
[dir="rtl"] .msa-form-select {
	background-position: left 12px center;
	padding-right: 14px;
	padding-left: 40px;
}

[dir="rtl"] .msa-profile-title,
[dir="rtl"] .msa-login-title,
[dir="rtl"] .msa-section-title,
[dir="rtl"] .msa-form-label,
[dir="rtl"] .msa-form-help {
	text-align: right;
}

[dir="rtl"] .msa-profile-picture-upload-btn {
	right: auto;
	left: 0;
}

[dir="rtl"] .msa-cert-icon {
	margin-right: 0;
	margin-left: 20px;
}

[dir="rtl"] .msa-cert-details {
	margin-right: 0;
	margin-left: 20px;
}

[dir="rtl"] .msa-certificate-item .msa-btn svg {
	margin-right: 0;
	margin-left: 8px;
}

/* ===========================
   Repeater Fields
   =========================== */
.msa-section-header-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
border-bottom: 1px solid #e5e7eb;
padding-bottom: 10px;
}

.msa-section-header-row .msa-section-title {
margin: 0;
border: none;
padding: 0;
}

.msa-repeater-container {
display: flex;
flex-direction: column;
gap: 20px;
}

.msa-repeater-item {
background: #fff;
border: 1px solid var(--msa-border);
border-radius: var(--msa-radius);
overflow: hidden;
}

.msa-repeater-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 20px;
background: #f9fafb;
border-bottom: 1px solid var(--msa-border);
}

.msa-repeater-title {
font-weight: 600;
color: var(--msa-text);
}

.msa-remove-item-btn {
background: transparent;
border: none;
color: var(--msa-danger);
cursor: pointer;
padding: 5px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
transition: all 0.2s ease;
}

.msa-remove-item-btn:hover {
background: #fee2e2;
}

.msa-repeater-content {
padding: 20px;
}

.msa-checkbox-label {
display: flex;
align-items: center;
gap: 8px;
margin-top: 8px;
font-size: 14px;
color: var(--msa-text);
cursor: pointer;
}
