/* =========================================================
   DevRoots — Custom Stylesheet
   Overrides & new components on top of style.css
   ========================================================= */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #4761FF;
    --primary-dark: #2e47e0;
    --accent: #FF6B35;
    --secondary: #555555;
    --light: #F4F6FF;
    --dark: #0f1225;
    --text: #3a3a4a;
    --muted: #7a7a96;
    --card-shadow: 0 8px 32px rgba(71, 97, 255, 0.10);
    --transition: all 0.3s ease;
}

/* ---------- Base ---------- */
body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    scroll-behavior: smooth;
    background: #fff;
}

body.rtl {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
}

body.rtl .ms-auto { margin-left: unset !important; margin-right: auto !important; }
body.rtl .me-2  { margin-right: unset !important; margin-left: 0.5rem !important; }
body.rtl .me-3  { margin-right: unset !important; margin-left: 1rem !important; }
body.rtl .ms-1  { margin-left: unset !important; margin-right: 0.25rem !important; }
body.rtl .ms-3  { margin-left: unset !important; margin-right: 1rem !important; }
body.rtl .footer-links li a::before { transform: scaleX(-1); }
body.rtl .text-end { text-align: left !important; }
body.rtl .justify-content-end { justify-content: flex-start !important; }

/* ---------- Topbar ---------- */
.topbar-wrap {
    background: var(--dark);
    color: #b0b9cc;
    padding: 10px 0;
    font-size: 14px;
}

.topbar-wrap a {
    color: #b0b9cc;
    text-decoration: none;
    transition: color 0.2s;
}

.topbar-wrap a:hover { color: #fff; }

.topbar-brand {
    font-size: 20px;
    font-weight: 800;
    color: #fff !important;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---------- Language Toggle ---------- */
.lang-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover { background: var(--primary-dark); }
.lang-btn-sm { padding: 3px 12px; font-size: 12px; }

/* ---------- Navbar ---------- */
.navbar-wrap {
    top: -100px;
    transition: top 0.5s ease;
}

.navbar-brand {
    text-decoration: none;
}

.brand-logo-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    position: relative;
}

.brand-logo-icon::after {
    content: 'D';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
}

.brand-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.navbar .navbar-nav .nav-link {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    padding: 28px 14px;
    position: relative;
    transition: color 0.25s;
}

.navbar .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 18px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    border-radius: 2px;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--primary);
}

.navbar .navbar-nav .nav-link:hover::after,
.navbar .navbar-nav .nav-link.active::after {
    transform: scaleX(1);
}

body.rtl .navbar .navbar-nav .nav-link::after {
    left: auto;
    right: 14px;
}

@media (max-width: 991.98px) {
    .navbar .navbar-nav .nav-link {
        padding: 10px 0;
    }
    .navbar .navbar-nav .nav-link::after { display: none; }
}

/* ---------- Hero ---------- */
.hero-section { margin-bottom: 0; }

.hero-slide {
    min-height: 92vh;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-slide-1 {
    background-image: url('https://i.ibb.co/Fw6vQJ4/b1.jpg');
}

.hero-slide-2 {
    background-image: url('https://i.ibb.co/mzvvZMK/b2.jpg');
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(15,18,37,0.82) 0%, rgba(71,97,255,0.25) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 60px 0;
}

.hero-sub {
    font-size: 18px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 16px;
    font-weight: 500;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 32px;
}

.btn-hero {
    padding: 14px 36px;
    font-weight: 600;
    font-size: 16px;
    border-radius: 50px;
    transition: var(--transition);
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(71,97,255,0.3);
}

@media (max-width: 768px) {
    .hero-slide { min-height: 70vh; }
}

/* ---------- Features ---------- */
.features-section {
    padding: 0;
    margin-top: -70px;
    position: relative;
    z-index: 10;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(71,97,255,0.12);
}

@media (max-width: 991.98px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575.98px) {
    .features-grid { grid-template-columns: 1fr; }
    .features-section { margin-top: 0; }
}

.feature-card {
    padding: 36px 28px;
    text-align: center;
    border-right: 1px solid #f0f0f8;
    transition: var(--transition);
}

.feature-card:last-child { border-right: none; }

body.rtl .feature-card { border-right: none; border-left: 1px solid #f0f0f8; }
body.rtl .feature-card:last-child { border-left: none; }

.feature-card:hover {
    background: var(--primary);
}

.feature-card:hover h5,
.feature-card:hover p {
    color: #fff;
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    transition: var(--transition);
}

.feature-card:hover .feature-icon {
    background: rgba(255,255,255,0.2);
}

.feature-icon img { width: 32px; height: 32px; object-fit: contain; }

.feature-card h5 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark);
    transition: var(--transition);
}

.feature-card p {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
    transition: var(--transition);
}

/* ---------- Section Helpers ---------- */
.section-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto;
}

.section-desc {
    font-size: 16px;
    color: var(--muted);
    line-height: 1.8;
}

/* ---------- About ---------- */
.about-section {
    padding: 100px 0;
    background: var(--light);
}

.about-img-wrap {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.about-main-img {
    width: 100%;
    height: 480px;
    object-fit: cover;
    border-radius: 20px;
    display: block;
}

.about-badge {
    position: absolute;
    bottom: 24px;
    right: 24px;
    background: var(--primary);
    color: #fff;
    border-radius: 16px;
    padding: 16px 24px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(71,97,255,0.35);
}

body.rtl .about-badge { right: auto; left: 24px; }

.about-badge-num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.about-badge-text {
    font-size: 12px;
    opacity: 0.9;
}

.about-feature {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.about-feature-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

.about-feature h6 {
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--dark);
}

.about-feature span {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

/* ---------- Services ---------- */
.services-section {
    padding: 100px 0;
    background: #fff;
}

.section-header { margin-bottom: 16px; }

.service-card {
    background: #fff;
    border: 1px solid #eef0fb;
    border-radius: 20px;
    padding: 36px 28px;
    height: 100%;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, #7c8fff 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 20px;
}

.service-card:hover::before { opacity: 1; }

.service-card:hover h5,
.service-card:hover p,
.service-card:hover .service-link {
    color: #fff;
    position: relative;
    z-index: 2;
}

.service-card-icon {
    width: 64px;
    height: 64px;
    background: var(--light);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.service-card:hover .service-card-icon {
    background: rgba(255,255,255,0.2);
}

.service-card-icon img { width: 36px; height: 36px; object-fit: contain; }

.service-card h5 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
    transition: var(--transition);
}

.service-card p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
    transition: var(--transition);
}

.service-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    position: relative;
    z-index: 2;
    transition: var(--transition);
}

/* ---------- Courses ---------- */
.courses-section {
    padding: 100px 0;
    background: var(--light);
}

.course-card {
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    height: 100%;
    transition: var(--transition);
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(71,97,255,0.18);
}

.course-card-header {
    padding: 40px 28px 28px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.course-web    { background: linear-gradient(135deg, #4761FF, #7c8fff); }
.course-mobile { background: linear-gradient(135deg, #FF6B35, #ffb399); }
.course-design { background: linear-gradient(135deg, #8E44AD, #c39bd3); }

.course-icon {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.25);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    backdrop-filter: blur(4px);
}

.course-badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.4);
}

.course-card-body {
    padding: 28px;
}

.course-card-body h4 {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 10px;
}

.course-card-body p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 20px;
}

.course-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--light);
    border-radius: 12px;
}

.course-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.course-meta-item i {
    font-size: 20px;
    color: var(--primary);
}

.course-meta-item small {
    display: block;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.course-meta-item strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
}

.course-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.topic-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    background: var(--light);
    color: var(--primary);
    border-radius: 20px;
    border: 1px solid rgba(71,97,255,0.15);
}

/* ---------- Projects ---------- */
.projects-section {
    padding: 100px 0;
    background: #fff;
}

/* ---------- Contact ---------- */
.contact-section {
    padding: 100px 0;
    background: var(--light);
}

.contact-cta-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

.contact-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    transition: var(--transition);
}

.contact-cta-btn:hover { color: var(--primary); }

.contact-cta-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.contact-form-card {
    background: #fff;
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: var(--card-shadow);
}

.contact-form-card .form-control,
.contact-form-card .form-select {
    border: 1.5px solid #e8eaf6;
    border-radius: 12px;
    font-size: 15px;
    transition: border-color 0.25s;
}

.contact-form-card .form-control:focus,
.contact-form-card .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(71,97,255,0.12);
}

@media (max-width: 575.98px) {
    .contact-form-card { padding: 28px 20px; }
}

/* ---------- Clients ---------- */
.clients-section {
    padding: 80px 0;
    background: #fff;
}

.client-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
}

.client-item img {
    max-height: 100px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: grayscale(60%);
    opacity: 0.7;
    transition: var(--transition);
    border-radius: 12px;
}

.client-item:hover img,
.owl-item.center .client-item img {
    filter: grayscale(0%);
    opacity: 1;
}

/* ---------- Footer ---------- */
.footer-section {
    background: var(--dark);
    color: #8a94b0;
    padding: 80px 0 0;
}

.footer-brand {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.footer-tagline {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
}

.footer-contact p {
    font-size: 14px;
    margin-bottom: 8px;
}

.footer-contact i { color: var(--primary); }

.footer-heading {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 12px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

body.rtl .footer-heading::after { left: auto; right: 0; }

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li { margin-bottom: 10px; }

.footer-links li a {
    color: #8a94b0;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links li a::before {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: var(--primary);
}

body.rtl .footer-links li a::before {
    content: '\f104';
}

.footer-links li a:hover { color: #fff; padding-left: 4px; }
body.rtl .footer-links li a:hover { padding-left: 0; padding-right: 4px; }

.footer-hours {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.newsletter-form {
    display: flex;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid rgba(255,255,255,0.08);
}

.newsletter-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: none;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.newsletter-input::placeholder { color: #6a74a0; }

.newsletter-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.newsletter-btn:hover { background: var(--primary-dark); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 24px 0;
    margin-top: 60px;
    text-align: center;
    font-size: 14px;
}

/* ---------- Back to Top ---------- */
.back-to-top {
    position: fixed;
    display: none;
    right: 28px;
    bottom: 28px;
    z-index: 999;
    width: 44px;
    height: 44px;
    box-shadow: 0 4px 16px rgba(71,97,255,0.35);
}

body.rtl .back-to-top { right: auto; left: 28px; }

/* ---------- Buttons ---------- */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

/* ---------- Spinner ---------- */
#spinner.show {
    visibility: visible;
    opacity: 1;
}

/* ---------- Existing owl carousel adjustments ---------- */
.project-carousel .owl-nav {
    position: absolute;
    top: -80px;
    right: 0;
    display: flex;
    gap: 12px;
}

body.rtl .project-carousel .owl-nav { right: auto; left: 0; }

.project-carousel .owl-nav .owl-prev,
.project-carousel .owl-nav .owl-next {
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    font-size: 20px;
    transition: var(--transition);
    margin: 0;
}

.project-carousel .owl-nav .owl-prev:hover,
.project-carousel .owl-nav .owl-next:hover {
    background: var(--primary);
    color: #fff;
}

.testimonial-carousel .owl-nav {
    position: absolute;
    top: -80px;
    right: 0;
    display: flex;
    gap: 12px;
}

.testimonial-carousel .owl-nav .owl-prev,
.testimonial-carousel .owl-nav .owl-next {
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    font-size: 20px;
    transition: var(--transition);
    margin: 0;
}

.testimonial-carousel .owl-nav .owl-prev:hover,
.testimonial-carousel .owl-nav .owl-next:hover {
    background: var(--primary);
    color: #fff;
}

/* ---------- Project item ---------- */
.project-item {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.project-item .project-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(71,97,255,0.7);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-item:hover .project-overlay { opacity: 1; }

.project-item img,
.project-item video {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.project-item .p-4 a { color: var(--dark); font-weight: 700; text-decoration: none; }
.project-item .p-4 span { font-size: 14px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .about-main-img { height: 300px; }
    .course-meta { flex-direction: column; gap: 10px; }
    .contact-form-card { padding: 24px 16px; }
    .features-section { margin-top: 0; padding: 40px 0; }
    .features-grid { border-radius: 0; box-shadow: none; }
    .section-header { text-align: center !important; }
}
