/* =========================================================
   EdWay components — مكونات الصفحات (بروفايل، كورسات، إحصائيات…)
   بتعتمد على التوكنز المعرّفة في layouts/app.blade.php
   (الوضع الليلي شغال تلقائياً بدون أي قواعد [data-theme="dark"])
   ضعه في: public/css/edway-components.css
   ========================================================= */

/* ---------- أزرار ---------- */
.btn-edluxe, .btn-edluxe-success, .btn-edluxe-warning {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    border: 0; color: #fff; padding: .65rem 1.4rem; border-radius: 12px; font-weight: 600;
    text-decoration: none; transition: filter .2s, box-shadow .2s;
}
.btn-edluxe { background: var(--brand); }
.btn-edluxe-success { background: var(--gradient-success); }
.btn-edluxe-warning { background: var(--gradient-warning); }
.btn-edluxe:hover, .btn-edluxe-success:hover, .btn-edluxe-warning:hover { color: #fff; filter: brightness(1.08); box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .5); }

/* ---------- كروت عامة ---------- */
.card-edluxe { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-header-edluxe { background: var(--gradient-primary); color: #fff; border: 0; padding: 1.1rem 1.25rem; font-weight: 600; }
.feature-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-100); color: var(--brand); display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 1rem; }

/* ---------- Hero ---------- */
.hero-section {
    position: relative; overflow: hidden; color: #fff; padding: 96px 0;
    background: var(--gradient-primary);
    border-radius: 0 0 40px 40px;
    width: 100vw; max-width: 100vw; margin-inline: calc(50% - 50vw); margin-top: -.5rem;
}
.hero-section::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px); background-size: 24px 24px;
}
.hero-section > .container { position: relative; z-index: 2; }
#mainSlider { width: 100vw; margin-inline: calc(50% - 50vw); margin-top: -.5rem; }
.carousel-item { overflow-x: hidden; }
.carousel-item .hero-section { margin-inline: 0; margin-top: 0; }
.carousel-item .hero-section .btn, .carousel-item .hero-section .btn-edluxe, .carousel-item .hero-section .btn-outline-light { position: relative; z-index: 10; pointer-events: auto; }

/* ---------- البروفايل ---------- */
.profile-container { max-width: 1200px; margin: 0 auto; padding: 2px; }
.profile-header {
    position: relative; overflow: hidden; color: #fff; text-align: center;
    background: var(--gradient-primary); border-radius: 24px; padding: 40px 30px; margin-bottom: 110px;
    box-shadow: var(--shadow-md);
}
.profile-header::before { content: ""; position: absolute; top: 0; inset-inline-end: 0; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 70%); transform: translate(30%, -30%); }
.avatar-container { position: relative; width: 160px; height: 160px; margin: 0 auto 28px; z-index: 2; }
.avatar { width: 100%; height: 100%; border-radius: 50%; border: 5px solid var(--surface); object-fit: cover; background: var(--surface); box-shadow: var(--shadow-md); }
.profile-badge { position: absolute; bottom: 8px; inset-inline-end: 8px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--success); color: #fff; border: 3px solid var(--surface); z-index: 3; }
.profile-info { position: relative; z-index: 2; padding: 0 20px; }
.profile-name { font-size: 2.1rem; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; color: #fff; }
.verified-badge { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--warning); color: #1f2937; font-size: .85rem; }
.teacher-badge, .profile-specialization, .meta-item {
    display: inline-flex; align-items: center; gap: 10px; color: #fff;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px; padding: 8px 20px; backdrop-filter: blur(8px); font-size: .95rem;
}
.teacher-badge, .profile-specialization { margin: 12px 0; }
.user-meta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; }
.edit-profile-btn {
    position: absolute; top: 22px; inset-inline-start: 22px; z-index: 3; border: 0; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600;
    background: #fff; color: #0e1a2e; padding: 10px 22px; border-radius: 999px; box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
.edit-profile-btn:hover { background: var(--brand-50); color: var(--brand); }

.booking-section { text-align: center; margin: 36px 0 28px; }
.booking-btn {
    display: inline-flex; align-items: center; gap: 12px; border: 0; cursor: pointer; color: #fff; font-family: inherit;
    background: var(--gradient-success); padding: 15px 42px; border-radius: 999px; font-size: 1.08rem; font-weight: 600;
    box-shadow: 0 12px 28px -12px var(--success); transition: filter .2s;
}
.booking-btn:hover { filter: brightness(1.08); }

.profile-card {
    position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; padding: 32px; margin: 28px 0; box-shadow: var(--shadow-sm);
}
.profile-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--gradient-primary); }
.profile-card .card-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }

.teacher-details { background: color-mix(in srgb, var(--success) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); border-radius: 16px; padding: 26px; margin-top: 22px; }
.teacher-details-title { color: var(--success); font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.teacher-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.teacher-info-item, .info-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.teacher-info-label, .info-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; color: var(--muted); margin-bottom: 8px; }
.teacher-info-value, .info-value { font-weight: 500; word-break: break-word; font-size: 1.05rem; }
.rating-display { display: flex; align-items: center; gap: 6px; direction: ltr; }
.rating-display .fa-star { color: var(--warning); font-size: 1.2rem; }
.rating-display .fa-star.empty { color: var(--border); }
.rating-value { font-weight: 700; margin-inline-start: 10px; font-size: 1.15rem; }

/* ---------- كروت الكورسات ---------- */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; margin-top: 22px; }
.course-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; transition: box-shadow .25s, border-color .25s; }
.course-card:hover { box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.course-thumb { height: 176px; background: var(--surface-2) center / cover no-repeat; position: relative; }
.course-thumb::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, rgba(0, 0, 0, .3)); }
.course-info { padding: 22px; }
.course-title { font-size: 1.1rem; font-weight: 700; line-height: 1.5; min-height: 3.2em; margin-bottom: 12px; }
.course-price { display: flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 700; font-size: 1.25rem; margin: 12px 0; }
.course-buttons { display: flex; gap: 10px; margin-top: 18px; }
.course-link, .buy-btn { flex: 1; padding: 11px 0; text-align: center; text-decoration: none; border-radius: 12px; font-weight: 600; font-size: .94rem; transition: background-color .2s, color .2s; }
.course-link { border: 1.5px solid var(--border); color: var(--text); background: transparent; }
.course-link:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.buy-btn { background: var(--brand); color: #fff; border: 0; }
.buy-btn:hover { background: var(--brand-600); color: #fff; }

/* ---------- روابط التواصل في البروفايل ---------- */
.social-links-container { margin-top: 32px; }
.social-icons { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 22px; }
.social-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.2rem; text-decoration: none; transition: transform .2s; }
.social-icon:hover { transform: translateY(-4px); color: #fff; }
.social-icon.facebook { background: #1877f2; } .social-icon.twitter { background: #111; } .social-icon.youtube { background: #f00; }
.social-icon.instagram { background: linear-gradient(45deg, #405de6, #833ab4, #c13584, #fd1d1d); }
.social-icon.whatsapp { background: #25d366; } .social-icon.telegram { background: #08c; } .social-icon.linkedin { background: #0077b5; }
.social-icon.tiktok { background: #000; } .social-icon.email { background: #ea4335; } .social-icon.website { background: var(--brand); }

/* ---------- معلومات الحساب والإحصائيات ---------- */
.account-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 22px; }
.info-item { background: var(--surface-2); }
.profile-link { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 600; text-decoration: none; }
.profile-link:hover { color: var(--brand-600); text-decoration: underline; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; margin-top: 22px; }
.stat-card { position: relative; overflow: hidden; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; }
.stat-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gradient-primary); }
.stat-value { font-size: 2.1rem; font-weight: 800; color: var(--brand); line-height: 1.2; margin-bottom: 6px; }
.stat-label { color: var(--muted); font-size: .93rem; font-weight: 500; }

/* ---------- عناصر عائمة ونوافذ ---------- */
.floating-actions { position: fixed; bottom: 28px; inset-inline-start: 28px; z-index: 1000; display: flex; flex-direction: column; gap: 14px; }
.floating-btn {
    position: relative; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-size: 1.2rem;
    background: var(--gradient-primary); box-shadow: 0 10px 26px -8px var(--brand); display: grid; place-items: center; transition: transform .2s;
}
.floating-btn:hover { transform: scale(1.08); }
.floating-btn.auth-btn { background: var(--gradient-success); }
.floating-btn::after {
    content: attr(data-tooltip); position: absolute; inset-inline-start: 68px; background: #0e1a2e; color: #fff; padding: 7px 14px;
    border-radius: 10px; font-size: .85rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.floating-btn:hover::after { opacity: 1; }

.auth-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(8, 14, 26, .55); backdrop-filter: blur(5px); }
.auth-modal-content { position: relative; width: 90%; max-width: 400px; text-align: center; padding: 40px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); animation: modalIn .25s ease; }
.auth-modal-close { position: absolute; top: 14px; inset-inline-start: 14px; border: 0; background: none; color: var(--muted); font-size: 1.4rem; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; }
.auth-modal-close:hover { background: var(--surface-2); color: var(--danger); }
@keyframes modalIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

.empty-state { text-align: center; padding: 48px 28px; color: var(--muted); }
.empty-state i { font-size: 3.2rem; margin-bottom: 18px; opacity: .35; }
.empty-state p { font-size: 1.1rem; margin: 0; }
.bio-text { line-height: 1.9; font-size: 1.05rem; }

/* ---------- موبايل ---------- */
@media (max-width: 768px) {
    .hero-section { padding: 64px 0; border-radius: 0 0 28px 28px; }
    .profile-header { padding: 28px 18px; margin-bottom: 90px; border-radius: 20px; }
    .avatar-container { width: 136px; height: 136px; }
    .profile-name { font-size: 1.7rem; }
    .edit-profile-btn { position: relative; inset: auto; width: 100%; justify-content: center; margin-bottom: 18px; }
    .courses-grid, .account-info-grid, .teacher-info-grid { grid-template-columns: 1fr; }
    .profile-card { padding: 22px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .course-buttons { flex-direction: column; }
    .user-meta { flex-direction: column; align-items: stretch; }
    .meta-item { justify-content: center; }
    .stats-grid { grid-template-columns: 1fr; }
    .booking-btn { width: 100%; justify-content: center; }
    .floating-actions { bottom: 18px; inset-inline-start: 18px; }
    .floating-btn { width: 50px; height: 50px; }
}
