/*
 Theme Name:   Ivons — MasterStudy Child
 Theme URI:    https://ivons.sa
 Description:  Ivons Training Platform — Custom child theme for MasterStudy with Ivons design system
 Author:       Ivons Team
 Author URI:   https://ivons.sa
 Template:     masterstudy
 Version:      1.1.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  ivons
 Tags:         education, lms, rtl, arabic, teal, violet
*/

/* ============================================
   IVONS CHILD THEME STYLES
   ============================================
   This file loads AFTER the parent theme and
   the Ivons design system. Use it for:
   - WordPress-specific overrides
   - Elementor Theme Builder support
   - Header & Footer base styles
   - Widget styling

   The main design system is in ivons-design-system.css
   MasterStudy LMS overrides are in masterstudy-overrides.css
   ============================================ */

/* ============================================
   1. SITE STRUCTURE
   ============================================ */

.ivons-site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
}

/* ============================================
   2. ELEMENTOR THEME BUILDER SUPPORT
   ============================================ */

/* Ensure Elementor header/footer stretches full width */
.elementor-location-header,
.elementor-location-footer {
  width: 100%;
}

/* Elementor sections should not add extra padding conflicting with Ivons sections */
.elementor-section.ivons-section > .elementor-container {
  max-width: var(--iv-container-max);
}

/* ============================================
   3. HEADER STYLES
   ============================================ */

/* Top Bar */
.ivons-top-bar {
  background: linear-gradient(135deg, #0A5C55, var(--iv-primary-900));
  color: white;
  font-size: var(--iv-text-xs);
  font-weight: var(--iv-weight-medium);
  padding: 8px 0;
  position: relative;
  z-index: 1001;
  animation: iv-slideDown 0.5s ease-out;
}
.ivons-top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--iv-space-3);
  position: relative;
}
.ivons-top-bar-icon { font-size: 16px; animation: iv-pulse 2s infinite; }
.ivons-top-bar-link {
  color: var(--iv-primary-300);
  font-weight: var(--iv-weight-bold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ivons-top-bar-link:hover { color: white; }
.ivons-top-bar-close {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  border-radius: var(--iv-radius-full);
  color: rgba(255,255,255,0.8);
  font-size: var(--iv-text-small);
  cursor: pointer;
  border: none;
  transition: all var(--iv-transition-fast);
}
.ivons-top-bar-close:hover { background: rgba(255,255,255,0.25); color: white; }

/* Header — Claymorphism */
.ivons-header {
  position: sticky;
  top: 0;
  z-index: var(--iv-z-sticky);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(241,245,249,0.6);
  transition: all var(--iv-transition-normal);
}
.ivons-header.ivons-scrolled {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.03);
  border-bottom: 1px solid rgba(241,245,249,0.4);
}

/* Header Top (Logo + Search + Actions) */
.ivons-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: var(--iv-space-4);
}

/* Logo */
.ivons-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
  transition: transform var(--iv-transition-normal);
}
.ivons-logo:hover { transform: scale(1.02); }
.ivons-logo-mark {
  width: 40px;
  height: 40px;
  background: var(--iv-gradient-primary);
  border-radius: var(--iv-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--iv-weight-extrabold);
  font-size: 19px;
  font-family: var(--iv-font-en);
  position: relative;
  box-shadow: var(--iv-shadow-clay);
}
.ivons-logo-mark::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 6px;
  border-top: 2px solid rgba(255,255,255,0.4);
  border-left: 2px solid rgba(255,255,255,0.4);
  border-radius: 2px 0 0 0;
}
.ivons-logo-text {
  font-size: 24px;
  font-weight: var(--iv-weight-extrabold);
  color: var(--iv-primary-900);
  font-family: var(--iv-font-en);
  letter-spacing: -0.5px;
  position: relative;
}
.ivons-logo-text::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--iv-gradient-primary);
  border-radius: 1px;
  opacity: 0.4;
}

/* Search */
.ivons-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.ivons-search-input {
  width: 100%;
  padding: 12px 80px 12px 16px;
  border: 1.5px solid var(--iv-border-light);
  border-radius: 50px;
  font-family: var(--iv-font-ar);
  font-size: 15px;
  color: var(--iv-text-primary);
  background: var(--iv-bg-page);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
  transition: all var(--iv-transition-fast);
  outline: none;
}
.ivons-search-input::placeholder { color: var(--iv-text-light); }
.ivons-search-input:focus {
  border-color: var(--iv-primary-900);
  box-shadow: 0 0 0 3px rgba(15,118,110,0.1), var(--iv-shadow-clay);
  background: white;
}
.ivons-search form { margin: 0; }
.ivons-search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--iv-text-light);
  font-size: 16px;
  pointer-events: none;
  z-index: 2;
}
.ivons-search-shortcut {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-family: var(--iv-font-en), Arial, sans-serif;
  font-size: 11px;
  color: var(--iv-text-light);
  font-weight: 600;
  background: white;
  border: 1px solid var(--iv-border);
  border-radius: 4px;
  padding: 2px 7px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  line-height: 1.4;
  white-space: nowrap;
}

/* Header Actions — Claymorphism */
.ivons-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ivons-btn-login {
  padding: 10px 20px;
  font-size: 15px;
  font-weight: var(--iv-weight-semibold);
  color: var(--iv-text-secondary);
  border-radius: var(--iv-radius-lg);
  transition: all var(--iv-transition-fast);
  text-decoration: none;
  background: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: var(--iv-font-ar);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ivons-btn-login:hover {
  color: var(--iv-primary-900);
  background: var(--iv-primary-50);
  border-color: var(--iv-primary-100);
}
.ivons-btn-register {
  padding: 10px 22px;
  font-size: 15px;
  font-weight: var(--iv-weight-semibold);
  background: var(--iv-gradient-primary);
  color: white;
  border-radius: var(--iv-radius-lg);
  transition: all var(--iv-transition-normal);
  box-shadow: var(--iv-shadow-clay), 0 2px 12px rgba(15,118,110,0.25);
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--iv-font-ar);
}
.ivons-btn-register:hover {
  background: linear-gradient(135deg, #0D6B63, var(--iv-primary-700));
  box-shadow: var(--iv-shadow-clay-hover), 0 4px 16px rgba(15,118,110,0.35);
  transform: translateY(-1px);
}

/* User Dropdown Menu — Glass */
.ivons-user-menu {
  position: relative;
}
.ivons-user-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.ivons-user-toggle .arrow {
  font-size: var(--iv-text-tag);
  opacity: 0.5;
  transition: transform var(--iv-transition-fast);
}
.ivons-user-menu:hover .ivons-user-toggle .arrow {
  transform: rotate(180deg);
}
.ivons-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--iv-glass-bg);
  backdrop-filter: var(--iv-glass-blur);
  -webkit-backdrop-filter: var(--iv-glass-blur);
  border: var(--iv-glass-border);
  border-radius: var(--iv-radius-xl);
  box-shadow: var(--iv-shadow-glass), 0 12px 40px rgba(0,0,0,0.08);
  padding: 8px;
  min-width: 200px;
  z-index: var(--iv-z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--iv-transition-normal);
  pointer-events: none;
}
.ivons-user-menu:hover .ivons-user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.ivons-user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: var(--iv-text-small);
  font-weight: var(--iv-weight-medium);
  color: var(--iv-text-secondary);
  border-radius: var(--iv-radius-md);
  transition: all var(--iv-transition-fast);
  text-decoration: none;
}
.ivons-user-dropdown a:hover {
  color: var(--iv-primary-900);
  background: var(--iv-primary-50);
}
.ivons-user-dropdown a i {
  font-size: 16px;
  color: var(--iv-text-light);
}
.ivons-user-dropdown a:hover i {
  color: var(--iv-primary-700);
}
.ivons-user-dropdown-divider {
  height: 1px;
  background: var(--iv-border-light);
  margin: 4px 8px;
}
.ivons-user-logout {
  color: #EF4444 !important;
}
.ivons-user-logout i {
  color: #EF4444 !important;
}
.ivons-user-logout:hover {
  background: #FEF2F2 !important;
}

/* Navigation */
.ivons-nav {
  border-top: 1px solid var(--iv-border-light);
}
.ivons-nav-list {
  display: flex !important;
  align-items: center;
  gap: 4px;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
  background: none !important;
  position: relative;
}
.ivons-nav-item, .ivons-nav-list > li {
  position: relative !important;
  float: none !important;
  display: inline-block !important;
}
.ivons-nav-link {
  display: flex !important;
  align-items: center;
  gap: 4px;
  padding: 12px 16px !important;
  font-size: 15px !important;
  font-weight: var(--iv-weight-medium) !important;
  color: var(--iv-text-secondary) !important;
  border-radius: var(--iv-radius-md) !important;
  transition: all var(--iv-transition-fast);
  text-decoration: none !important;
  background: none !important;
  border: none !important;
  line-height: 1.5 !important;
}
.ivons-nav-link:hover { color: var(--iv-primary-900) !important; background: var(--iv-primary-100) !important; }
.ivons-nav-link.active,
.ivons-nav-link[aria-current="page"] {
  color: var(--iv-primary-900) !important;
  font-weight: var(--iv-weight-bold) !important;
  position: relative;
}
.ivons-nav-link.active::after,
.ivons-nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--iv-gradient-primary);
  border-radius: 1px;
}
.ivons-nav-link .arrow {
  font-size: var(--iv-text-tag);
  opacity: 0.5;
  transition: transform var(--iv-transition-fast);
}
.ivons-nav-item:hover .ivons-nav-link .arrow,
.ivons-nav-list > li:hover .ivons-nav-link .arrow { transform: rotate(180deg); }

/* Dropdown Sub-Menu */
.ivons-nav-list .sub-menu {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  left: auto !important;
  background: white !important;
  border-radius: var(--iv-radius-2xl) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06) !important;
  border: 1px solid var(--iv-border-light) !important;
  padding: 16px 20px !important;
  min-width: 240px !important;
  z-index: var(--iv-z-dropdown) !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--iv-transition-normal);
  pointer-events: none;
  list-style: none !important;
  display: block !important;
  float: none !important;
  margin: 0 !important;
}
.ivons-nav-item.menu-item-has-children:hover > .sub-menu,
.ivons-nav-list .menu-item-has-children:hover > .sub-menu {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}
.ivons-nav-list .sub-menu li {
  position: relative !important;
  float: none !important;
  display: block !important;
  width: 100% !important;
}
.ivons-nav-list .sub-menu a {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 14px !important;
  font-size: 15px !important;
  font-weight: var(--iv-weight-medium) !important;
  color: var(--iv-text-secondary) !important;
  border-radius: var(--iv-radius-lg) !important;
  transition: all var(--iv-transition-fast);
  text-decoration: none !important;
  white-space: nowrap;
  background: none !important;
  border: none !important;
  line-height: 1.5 !important;
}
.ivons-nav-list .sub-menu a:hover {
  color: var(--iv-primary-900) !important;
  background: var(--iv-primary-100) !important;
}
.ivons-nav-list .sub-menu .current-menu-item > a,
.ivons-nav-list .sub-menu .current-menu-item a {
  color: var(--iv-primary-900) !important;
  font-weight: var(--iv-weight-bold) !important;
}

/* Mega Menu class (add "mega-menu" CSS class to menu item in WP admin) */
.ivons-nav-list .mega-menu > .sub-menu {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: var(--iv-space-4) !important;
  width: 720px !important;
  padding: 28px 32px !important;
}
@media (max-width: 1024px) {
  .ivons-nav-list .mega-menu > .sub-menu {
    width: 540px !important;
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Mobile Menu Button */
.ivons-mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--iv-radius-md);
  color: var(--iv-text-primary);
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
}

/* Mobile Navigation */
.ivons-mobile-nav {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: white;
  z-index: 9999;
  padding: 24px;
  transition: right 0.3s ease;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}
.ivons-mobile-nav.open { right: 0; }
.ivons-mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--iv-border-light);
}
.ivons-mobile-nav-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--iv-text-secondary);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--iv-radius-md);
  transition: all var(--iv-transition-fast);
}
.ivons-mobile-nav-close:hover { background: var(--iv-primary-100); color: var(--iv-primary-900); }
.ivons-mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ivons-mobile-nav-item { margin-bottom: 4px; }
.ivons-mobile-nav-link {
  display: block;
  padding: 12px 16px;
  font-size: var(--iv-text-body);
  font-weight: var(--iv-weight-medium);
  color: var(--iv-text-secondary);
  border-radius: var(--iv-radius-md);
  text-decoration: none;
  transition: all var(--iv-transition-fast);
}
.ivons-mobile-nav-link:hover,
.ivons-mobile-nav-link.active {
  color: var(--iv-primary-900);
  background: var(--iv-primary-100);
}
.ivons-mobile-nav-actions {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--iv-border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ivons-btn-block { width: 100%; text-align: center; justify-content: center; }
.ivons-mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.ivons-mobile-nav-overlay.open { opacity: 1; visibility: visible; }

/* ============================================
   4. FOOTER STYLES — Claymorphism
   ============================================ */

.ivons-footer {
  background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  position: relative;
  overflow: hidden;
}
.ivons-footer::before {
  content: '';
  position: absolute;
  top: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(15,118,110,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.ivons-footer::after {
  content: '';
  position: absolute;
  bottom: -150px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124,58,237,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Footer CTA Bar — Glass */
.ivons-footer-cta {
  padding: 48px 32px;
  margin-bottom: 48px;
  background: var(--iv-gradient-primary);
  border-radius: var(--iv-radius-2xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(15,118,110,0.3);
}
.ivons-footer-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.ivons-footer-cta::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: 10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(124,58,237,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.ivons-footer-cta-text {
  font-size: var(--iv-text-h3);
  font-weight: var(--iv-weight-bold);
  color: white;
  position: relative;
  z-index: 1;
}
.ivons-footer-cta .iv-btn-primary {
  position: relative;
  z-index: 1;
  background: white;
  color: var(--iv-primary-900);
  font-weight: var(--iv-weight-bold);
  border-radius: var(--iv-radius-lg);
  padding: 14px 28px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: all var(--iv-transition-normal);
}
.ivons-footer-cta .iv-btn-primary:hover {
  background: #F0FDFA;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* Footer Logo (dark variant) */
.ivons-footer-logo .ivons-logo-mark {
  background: rgba(255,255,255,0.12);
  box-shadow: none;
}
.ivons-footer-logo .ivons-logo-text { color: white; }

/* Footer Columns */
.ivons-footer-columns {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 48px 0;
  position: relative;
  z-index: 1;
}
.ivons-footer-brand-desc {
  font-size: var(--iv-text-small);
  line-height: 1.8;
  margin-bottom: var(--iv-space-4);
  color: rgba(255,255,255,0.5);
}
.ivons-footer-col-title {
  font-size: 16px;
  font-weight: var(--iv-weight-bold);
  color: white;
  margin-bottom: var(--iv-space-4);
  position: relative;
  padding-bottom: 8px;
}
.ivons-footer-col-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 2px;
  background: var(--iv-gradient-primary);
  border-radius: 1px;
}

/* Footer Links */
.ivons-footer-links { margin: 0; padding: 0; }
.ivons-footer-link {
  display: block;
  padding: 7px 0;
  font-size: var(--iv-text-small);
  color: rgba(255,255,255,0.5);
  transition: all var(--iv-transition-fast);
  text-decoration: none;
}
.ivons-footer-link:hover {
  color: var(--iv-primary-400);
  padding-right: 4px;
}

/* Footer Social — Glass */
.ivons-footer-social { display: flex; gap: 10px; }
.ivons-footer-social-link {
  width: 40px;
  height: 40px;
  border-radius: var(--iv-radius-full);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: rgba(255,255,255,0.5);
  transition: all var(--iv-transition-normal);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.ivons-footer-social-link:hover {
  background: var(--iv-gradient-primary);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15,118,110,0.4);
}

/* Footer Contact */
.ivons-footer-contact { margin: 0; }
.ivons-footer-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: var(--iv-text-small);
  color: rgba(255,255,255,0.5);
  transition: color var(--iv-transition-fast);
  text-decoration: none;
}
.ivons-footer-contact-item:hover { color: rgba(255,255,255,0.8); }
.ivons-footer-contact-item i { font-size: 16px; color: var(--iv-primary-400); }

/* Footer Newsletter — Clay */
.ivons-footer-newsletter { margin-top: var(--iv-space-4); }
.ivons-footer-newsletter-label {
  font-size: var(--iv-text-xs);
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
  display: block;
}
.ivons-footer-newsletter-form { display: flex; gap: 8px; }
.ivons-footer-newsletter-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--iv-radius-lg);
  color: white;
  font-family: var(--iv-font-ar);
  font-size: var(--iv-text-xs);
  outline: none;
  transition: all var(--iv-transition-fast);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.ivons-footer-newsletter-input::placeholder { color: rgba(255,255,255,0.35); }
.ivons-footer-newsletter-input:focus {
  border-color: var(--iv-primary-500);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 0 3px rgba(15,118,110,0.2), inset 0 1px 3px rgba(0,0,0,0.1);
}
.ivons-footer-newsletter-btn {
  padding: 10px 18px;
  background: var(--iv-gradient-primary);
  color: white;
  border-radius: var(--iv-radius-lg);
  font-family: var(--iv-font-ar);
  font-size: var(--iv-text-xs);
  font-weight: var(--iv-weight-semibold);
  cursor: pointer;
  transition: all var(--iv-transition-fast);
  border: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15,118,110,0.3);
}
.ivons-footer-newsletter-btn:hover {
  background: linear-gradient(135deg, #0D6B63, var(--iv-primary-600));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15,118,110,0.4);
}

/* Footer Trust Bar — Clay cards */
.ivons-footer-trust {
  padding: 24px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.ivons-footer-payment {
  padding: 8px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--iv-radius-lg);
  font-family: var(--iv-font-en);
  font-size: var(--iv-text-xs);
  font-weight: var(--iv-weight-bold);
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.5px;
  transition: all var(--iv-transition-fast);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.ivons-footer-payment:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Footer Bottom Bar */
.ivons-footer-bottom {
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--iv-text-tag);
  color: rgba(255,255,255,0.4);
  position: relative;
  z-index: 1;
}
.ivons-footer-bottom-links {
  display: flex;
  gap: 16px;
}
.ivons-footer-bottom-links a {
  color: rgba(255,255,255,0.4);
  transition: color var(--iv-transition-fast);
  text-decoration: none;
}
.ivons-footer-bottom-links a:hover { color: rgba(255,255,255,0.7); }

/* Footer widget title */
.footer-widget-title {
  font-family: var(--iv-font-ar);
  font-weight: var(--iv-weight-bold);
  color: white;
  font-size: var(--iv-text-body);
  margin-bottom: var(--iv-space-4);
  position: relative;
  padding-bottom: var(--iv-space-2);
}
.footer-widget-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 2px;
  background: var(--iv-primary-700);
  border-radius: var(--iv-radius-full);
}

/* ============================================
   5. SIDEBAR & WIDGET STYLES
   ============================================ */

.widget {
  margin-bottom: var(--iv-space-8);
  font-family: var(--iv-font-ar);
}

.widget-title {
  font-family: var(--iv-font-ar);
  font-weight: var(--iv-weight-bold);
  color: var(--iv-text-primary);
  font-size: var(--iv-text-h4);
  margin-bottom: var(--iv-space-4);
}

/* Course sidebar widgets */
.course-widget {
  background: var(--iv-bg-white);
  border: 1px solid var(--iv-border-light);
  border-radius: var(--iv-radius-xl);
  padding: var(--iv-space-6);
  margin-bottom: var(--iv-space-4);
}

.course-widget-title {
  font-family: var(--iv-font-ar);
  font-weight: var(--iv-weight-bold);
  color: var(--iv-text-primary);
  font-size: var(--iv-text-h4);
  margin-bottom: var(--iv-space-4);
}

/* ============================================
   6. PAGE & POST STYLES
   ============================================ */

/* Page title area */
.page-title-area {
  background: var(--iv-gradient-warm-bg);
  padding: var(--iv-space-12) 0;
  text-align: center;
}

.page-title-area h1 {
  font-family: var(--iv-font-ar);
  font-weight: var(--iv-weight-extrabold);
  color: var(--iv-text-primary);
  font-size: var(--iv-text-h2);
}

/* Entry content (for pages built without Elementor) */
.entry-content {
  font-family: var(--iv-font-ar);
  line-height: 1.9;
  color: var(--iv-text-primary);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-family: var(--iv-font-ar);
  font-weight: var(--iv-weight-bold);
  color: var(--iv-text-primary);
  margin-top: var(--iv-space-8);
  margin-bottom: var(--iv-space-4);
}

.entry-content p {
  margin-bottom: var(--iv-space-4);
}

.entry-content a {
  color: var(--iv-primary-900);
  font-weight: var(--iv-weight-semibold);
  transition: color var(--iv-transition-fast);
}

.entry-content a:hover {
  color: var(--iv-primary-700);
}

/* ============================================
   7. SKIP LINK (Accessibility)
   ============================================ */

.skip-link.screen-reader-text:focus {
  background: var(--iv-primary-900);
  color: white;
  font-family: var(--iv-font-ar);
  font-size: var(--iv-text-small);
  padding: var(--iv-space-2) var(--iv-space-4);
  border-radius: var(--iv-radius-lg);
  z-index: 100000;
  clip: auto !important;
  clip-path: none;
  position: absolute;
  top: var(--iv-space-2);
  right: var(--iv-space-2);
}

/* ============================================
   8. RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .ivons-footer-columns { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .ivons-nav { display: none; }
  .ivons-mobile-menu-btn { display: flex; }
  .ivons-search { display: none; }
  .ivons-header-top { padding: 10px 0; }
  .ivons-header-actions { gap: 6px; }
  .ivons-btn-login { padding: 6px 12px; font-size: var(--iv-text-xs); }
  .ivons-btn-register { padding: 6px 14px; font-size: var(--iv-text-xs); }

  .ivons-footer-columns { grid-template-columns: 1fr 1fr; }
  .ivons-footer-cta { flex-direction: column; gap: 16px; text-align: center; }
  .ivons-footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  .page-title-area {
    padding: var(--iv-space-8) 0;
  }

  .course-widget {
    padding: var(--iv-space-4);
  }
}

@media (max-width: 480px) {
  .ivons-footer-columns { grid-template-columns: 1fr; }
  .ivons-footer-cta { padding: 32px 20px; }
  .ivons-footer-cta-text { font-size: 16px; }
  .ivons-footer-newsletter-form { flex-direction: column; }
  .ivons-footer-newsletter-btn { width: 100%; }
}

/* ============================================
   9. MASTERSTUDY HEADER OVERRIDES
   (Targets the ACTUAL selectors rendered by the theme)
   ============================================ */

/* --- Font family globally --- */
#header,
#header .header_default,
#header .header_top_bar,
.header-menu,
.header-menu a,
.logo-unit,
.header-login-button,
.hfe-menu-item,
.hfe-sub-menu-item {
  font-family: var(--iv-font-ar) !important;
}

/* --- Top Bar --- */
.header_top_bar,
.header_2_top_bar {
  background: linear-gradient(135deg, #0A5C55, var(--iv-primary-900)) !important;
  color: white !important;
  font-size: 13px !important;
  font-weight: var(--iv-weight-medium) !important;
}

.header_2_top_bar a {
  color: var(--iv-primary-300) !important;
  font-weight: var(--iv-weight-bold) !important;
}
.header_2_top_bar a:hover { color: white !important; }

/* --- Header main area --- */
#header:not(.transparent_header) .header_default {
  background: rgba(255,255,255,0.97) !important;
  backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid var(--iv-border-light) !important;
}

/* --- Logo --- */
.logo-unit .logo,
.logo-unit a.logo {
  font-family: var(--iv-font-en) !important;
  font-weight: var(--iv-weight-extrabold) !important;
  color: var(--iv-primary-900) !important;
  font-size: 24px !important;
  letter-spacing: -0.5px !important;
}

/* --- Navigation menu --- */
.header-menu,
nav .header-menu {
  font-family: var(--iv-font-ar) !important;
  font-weight: var(--iv-weight-medium) !important;
  font-size: 15px !important;
}

a.hfe-menu-item {
  font-family: var(--iv-font-ar) !important;
  font-size: 15px !important;
  font-weight: var(--iv-weight-medium) !important;
  color: var(--iv-text-secondary) !important;
  padding: 12px 16px !important;
  transition: all var(--iv-transition-fast) !important;
}

a.hfe-menu-item:hover {
  color: var(--iv-primary-900) !important;
  background: var(--iv-primary-100) !important;
}

/* Active menu item */
.current-menu-item > a.hfe-menu-item,
.current-menu-parent > a.hfe-menu-item {
  color: var(--iv-primary-900) !important;
  font-weight: var(--iv-weight-bold) !important;
}

/* --- Sub-menu / Dropdown --- */
.hfe-nav-menu .sub-menu,
nav .sub-menu {
  background: white !important;
  border-radius: var(--iv-radius-2xl) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06) !important;
  border: 1px solid var(--iv-border-light) !important;
  padding: 12px 16px !important;
  min-width: 220px !important;
}

a.hfe-sub-menu-item {
  font-family: var(--iv-font-ar) !important;
  font-size: var(--iv-text-small) !important;
  font-weight: var(--iv-weight-medium) !important;
  color: var(--iv-text-secondary) !important;
  padding: 10px 14px !important;
  border-radius: var(--iv-radius-lg) !important;
  transition: all var(--iv-transition-fast) !important;
}

a.hfe-sub-menu-item:hover {
  color: var(--iv-primary-900) !important;
  background: var(--iv-primary-100) !important;
}

/* --- Auth buttons --- */
.header-login-button {
  font-family: var(--iv-font-ar) !important;
  font-size: 15px !important;
  font-weight: var(--iv-weight-semibold) !important;
  color: var(--iv-text-secondary) !important;
  border-radius: var(--iv-radius-md) !important;
  transition: all var(--iv-transition-fast) !important;
}

.header-login-button:hover {
  color: var(--iv-primary-900) !important;
}

.header-login-button.sign-up,
.sign-up {
  background: linear-gradient(135deg, var(--iv-accent-700), var(--iv-accent-600)) !important;
  color: white !important;
  box-shadow: 0 2px 10px rgba(124,58,237,0.3) !important;
  border-radius: var(--iv-radius-md) !important;
}

.header-login-button.sign-up:hover,
.sign-up:hover {
  background: linear-gradient(135deg, #6D28D9, var(--iv-accent-700)) !important;
  box-shadow: 0 4px 16px rgba(124,58,237,0.4) !important;
  transform: translateY(-1px) !important;
}

/* --- Search --- */
#header .header-search,
#header .stm_lms_search {
  font-family: var(--iv-font-ar) !important;
}

/* --- Accent color override (blue → teal) --- */
#header a:hover,
.header-menu a:hover,
.hfe-menu-item:hover {
  color: var(--iv-primary-900) !important;
}

/* Override MasterStudy accent #48a7d4 → Ivons teal */
.stm_lms_wishlist_button a,
.masterstudy_elementor_stm_lms_login a,
.btn-primary,
.btn-default {
  background-color: var(--iv-primary-900) !important;
}

/* --- Footer (MasterStudy native) --- */
#footer,
.footer,
.site-footer {
  background: #0F172A !important;
  color: rgba(255,255,255,0.7) !important;
  font-family: var(--iv-font-ar) !important;
}

#footer a,
.footer a,
.site-footer a {
  color: rgba(255,255,255,0.5) !important;
  font-family: var(--iv-font-ar) !important;
  font-size: var(--iv-text-small) !important;
  transition: color var(--iv-transition-fast) !important;
}

#footer a:hover,
.footer a:hover,
.site-footer a:hover {
  color: var(--iv-primary-700) !important;
}