/* ===================================
   تحسينات متقدمة للثيم
   Advanced Theme Improvements
   =================================== */

/* تحسين Typography */
body {
    font-size: 16px;
    line-height: 1.7;
    letter-spacing: 0.3px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    margin-bottom: 20px;
    color: #666;
}

/* تحسين الـ Spacing العام */
.optech-hero-section4 .container {
    max-width: 1320px;
    padding: 0 40px;
}

@media (max-width: 1199px) {
    .optech-hero-section4 .container {
        padding: 0 30px;
    }
}

@media (max-width: 991px) {
    .optech-hero-section4 .container {
        padding: 0 20px;
    }
}

/* تحسين الأزرار */
.optech-default-btn {
    padding: 18px 40px;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.optech-default-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.optech-btn-wrap {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;
}

@media (max-width: 767px) {
    .optech-btn-wrap {
        flex-direction: column;
        gap: 15px;
    }
    
    .optech-default-btn {
        width: 100%;
        text-align: center;
    }
}

/* تحسين Cards مع Glassmorphism */
.optech-iconbox-wrap.style-two {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.optech-iconbox-wrap.style-two:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.1);
}

/* تحسين الصور */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.optech-hero-thumb img,
.optech-portfolio-thumb img,
.optech-blog-thumb img {
    width: 100%;
    object-fit: cover;
}

/* Gradient Overlays */
.optech-portfolio-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 12px;
}

.optech-portfolio-wrap:hover .optech-portfolio-thumb::before {
    opacity: 1;
}

/* تحسين Navigation */
.site-navbar {
    padding: 0 20px;
}

.navbar .navbar-nav .nav-link {
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.navbar .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar .navbar-nav .nav-link:hover::after,
.navbar .navbar-nav .nav-link.active::after {
    width: 80%;
}

/* تحسين Header Top */
.optech-header-info ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.optech-header-info ul li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    transition: all 0.3s ease;
}

.optech-header-info ul li:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.optech-header-info ul li i {
    font-size: 18px;
}

/* تحسين Section Spacing */
.section + .section {
    margin-top: 0;
}

.optech-section-padding {
    padding: 120px 0;
}

.optech-section-padding2 {
    padding: 100px 0;
}

@media (max-width: 991px) {
    .optech-section-padding {
        padding: 80px 0;
    }
    
    .optech-section-padding2 {
        padding: 70px 0;
    }
}

@media (max-width: 767px) {
    .optech-section-padding {
        padding: 60px 0;
    }
    
    .optech-section-padding2 {
        padding: 50px 0;
    }
}

/* تحسين Grid Layout */
.row {
    --bs-gutter-x: 30px;
    --bs-gutter-y: 30px;
}

@media (max-width: 767px) {
    .row {
        --bs-gutter-x: 20px;
        --bs-gutter-y: 20px;
    }
}

/* تحسين Portfolio Grid */
.optech-portfolio-wrap {
    position: relative;
    overflow: hidden;
}

.optech-portfolio-data {
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0 0 12px 12px;
}

.optech-portfolio-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 20px;
    right: 20px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.optech-portfolio-wrap:hover .optech-portfolio-btn {
    opacity: 1;
    transform: scale(1);
}

/* تحسين Blog Cards */
.optech-blog-content {
    padding: 30px;
}

.optech-blog-content.reduced-padding {
    padding: 25px;
}

.optech-blog-meta ul {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.optech-blog-meta ul li {
    font-size: 14px;
    color: #999;
}

.optech-blog-meta ul li a {
    color: inherit;
    transition: color 0.3s ease;
}

.optech-blog-meta ul li a:hover {
    color: var(--primary-color, #007bff);
}

/* تحسين Footer */
.optech-footer-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.optech-footer-top {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.optech-footer-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.optech-footer-menu ul li {
    margin-bottom: 12px;
}

.optech-footer-menu ul li a {
    color: #666;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    padding-left: 20px;
}

.optech-footer-menu ul li a::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.optech-footer-menu ul li a:hover {
    color: var(--primary-color, #007bff);
    padding-left: 25px;
}

.optech-footer-menu ul li a:hover::before {
    opacity: 1;
}

/* تحسين Social Icons */
.optech-social-icon {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.optech-social-icon a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: #333;
    transition: all 0.3s ease;
}

.optech-social-icon a:hover {
    background: var(--primary-color, #007bff);
    color: #fff;
    transform: translateY(-3px);
}

/* تحسين Forms */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color, #007bff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color, #007bff), var(--secondary-color, #6c757d));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* تحسين Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color, #007bff);
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color, #007bff);
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* Print Styles */
@media print {
    .optech-header-section,
    .optech-footer-section,
    .optech-btn-wrap,
    .mobile-menu-trigger {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
}

/* Dark Mode Support (اختياري) */
@media (prefers-color-scheme: dark) {
    /* يمكن إضافة دعم للوضع الداكن هنا */
}

/* تحسين Performance */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
video {
    will-change: transform;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
