/* ========== UTILITY CLASSES ========== */
/* Helper classes, ordered lists, and miscellaneous utilities */

/* ========== Persian Ordered Lists ========== */
ol, .dir-ol {
    margin-top: 15px;
    margin-bottom: 15px;
    padding-right: 0 !important;
    padding-left: 0;
    direction: rtl;
    list-style-type: none !important;
    list-style: none !important;
    counter-reset: persian-list;
}

ol li {
    margin-bottom: 8px;
    line-height: 1.8;
    position: relative;
    padding-right: 35px;
    counter-increment: persian-list;
    list-style-type: none !important;
    list-style: none !important;
}

ol li::before {
    content: counter(persian-list, arabic-indic) ".";
    position: absolute;
    right: 10px;
    font-weight: bold;
    color: var(--primary-color);
}

ol li::marker {
    content: "";
    display: none;
}

/* ========== Responsive Display Utilities ========== */
.d-none-mobile {
    display: block;
}

@media (max-width: 768px) {
    .d-none-mobile {
        display: none !important;
    }
}

.d-mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .d-mobile-only {
        display: block !important;
    }
}

/* ========== Responsive Typography ========== */
@media (max-width: 768px) {
    .fs-mobile-small {
        font-size: 0.8rem !important;
    }
    
    .fs-mobile-normal {
        font-size: 0.9rem !important;
    }
    
    .fs-mobile-large {
        font-size: 1.1rem !important;
    }
}

/* ========== Responsive Spacing ========== */
@media (max-width: 768px) {
    .p-mobile-1 {
        padding: 0.5rem !important;
    }
    
    .p-mobile-2 {
        padding: 1rem !important;
    }
    
    .m-mobile-1 {
        margin: 0.5rem !important;
    }
    
    .m-mobile-2 {
        margin: 1rem !important;
    }
    
    .px-mobile-half {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .py-mobile-half {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
}

/* ========== List Responsive Adjustments ========== */
@media (max-width: 767px) {
    ol {
        padding-right: 0 !important;
        margin-right: 10px;
    }
    
    ol li {
        padding-right: 30px;
        font-size: 14px;
        list-style: none !important;
    }
    
    ol li::before {
        right: 5px;
        font-size: 14px;
    }
}

@media (max-width: 575px) {
    ol li {
        font-size: 13px;
        line-height: 1.6;
    }
}

/* ========== Loading States ========== */
.spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.spinner-container {
    text-align: center;
}

/* ========== Print Styles ========== */
@media print {
    .ad-container,
    .ad-sidebar,
    .ad-div-leftandright,
    nav,
    .navbar {
        display: none !important;
    }
    
    .hero-section,
    .shop-banner,
    .cta-section {
        background: none !important;
        color: black !important;
        border: 1px solid #ccc !important;
    }
    
    .tool-card {
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }
    
    .container-fluid {
        padding: 0 !important;
    }
}

/* ========== Accessibility Improvements ========== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-color) !important;
    }
    
    .btn {
        border: 2px solid currentColor !important;
    }
    
    .tool-card {
        border: 2px solid var(--primary-color) !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== Responsive Button Classes ========== */
@media (max-width: 576px) {
    .btn-sm-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
        line-height: 1.5;
        border-radius: 0.25rem;
    }
}

/* ========== Responsive Heading Classes ========== */
@media (max-width: 576px) {
    .h4-md {
        font-size: calc(1.275rem + 0.3vw);
    }
    
    .display-md-4 {
        font-size: calc(1.475rem + 2.7vw);
    }
}

@media (min-width: 768px) {
    .h4-md {
        font-size: 1.5rem;
    }
    
    .display-md-4 {
        font-size: 2.5rem;
    }
}

/* ========== Miscellaneous Utilities ========== */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }

.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-none { display: none !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }

.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }