  /**
   * Social Media Downloader - Main CSS
   * Version: 1.1.1
   * تمام کلاس‌ها با prefix smd- برای جلوگیری از تداخل
   */

/* ====================================
    Font Face - Yekan_Bakh
    ==================================== */
@font-face {
    font-family: 'Yekan_Bakh';
    src: local('Yekan_Bakh'), local('YekanBakh'), local('Yekan Bakh'), local('Yekan');
    font-display: swap;
}

/* ====================================
     Variables & Root
     ==================================== */
.smd-wrapper {
    --smd-primary-color: #7580E3;
    --smd-secondary-color: #4CAF50;
    --smd-error-color: #f44336;
     --smd-text-color: #2c3e50;
     --smd-text-secondary: #7f8c8d;
     --smd-border-color: #e0e6ed;
     --smd-bg-color: #ffffff;
     --smd-input-bg: #f8f9fa;
     --smd-shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
     --smd-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
     --smd-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
     --smd-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
     direction: rtl;
     text-align: right;
     font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
     -webkit-font-smoothing: antialiased;
     -moz-osx-font-smoothing: grayscale;
}

/* ====================================
   Reset Scoped
   ==================================== */
.smd-wrapper * {
    box-sizing: border-box;
}

.smd-wrapper img {
    max-width: 100%;
    height: auto;
    border: none;
}

/* ====================================
   Main Container
   ==================================== */
.smd-wrapper {
    width: 100%;
    margin: 20px auto;
    padding: 0;
    max-width: 100%;
    position: relative;
     overflow: hidden;
 }
 
 .smd-wrapper * {
     scroll-behavior: smooth;
 }
 
 /* اطمینان از نمایش اعداد به انگلیسی */
 .smd-wrapper {
     font-variant-numeric: lining-nums;
 }
 
 .smd-wrapper input,
 .smd-wrapper textarea {
     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
     unicode-bidi: embed;
 }

.smd-content {
    width: 100%;
    padding: 20px 0;
}

.smd-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ====================================
   Header Section
   ==================================== */
 .smd-header {
     text-align: center;
     padding: 32px 20px 20px;
     position: relative;
     margin-bottom: 24px;
 }

.smd-bg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    opacity: 0.1;
    pointer-events: none;
}

.smd-bg img {
    width: 400px;
    height: auto;
}

.smd-image {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.smd-image picture {
    display: inline-block;
    position: relative;
}

.smd-image img {
    width: 100px;
     height: 100px;
     object-fit: contain;
     filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
     transition: var(--smd-transition);
 }
 
 .smd-image img:hover {
     transform: scale(1.05);
 }

.smd-version {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: white;
    color: white;
    padding: 5px;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.smd-version b {
    font-weight: 700;
}

.smd-logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.smd-title {
    margin: 20px 0 10px;
}

.smd-title h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--smd-text-color);
     margin: 0;
     padding: 0;
     line-height: 1.4;
     font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
}

.smd-description {
    margin: 10px 0;
}

 .smd-description p {
     font-size: 15px;
     color: var(--smd-text-secondary);
     margin: 0;
     padding: 0;
     font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
 }

/* ====================================
   Form Section
   ==================================== */
 .smd-form {
     background: var(--smd-bg-color);
     border-radius: 8px;
     padding: 28px;
     box-shadow: var(--smd-shadow-md);
     margin-bottom: 20px;
     border: 1px solid var(--smd-border-color);
 }

 .smd-url-input {
     width: 100%;
     height: 52px;
     padding: 14px 18px;
     border: 2px solid var(--smd-border-color);
     border-radius: 6px !important;
     font-size: 15px;
     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
     transition: var(--smd-transition);
     margin-bottom: 14px;
     direction: ltr;
     text-align: left;
     background: var(--smd-input-bg);
     color: var(--smd-text-color);
     unicode-bidi: embed;
 }

 .smd-url-input:focus {
     outline: none;
     border-color: var(--smd-primary-color);
     background: var(--smd-input-bg);
     box-shadow: 0 0 0 4px rgba(117, 128, 227, 0.08);
     transform: translateY(-1px);
 }
 
 .smd-url-input:hover:not(:focus) {
     border-color: #c8cdd5;
     background: var(--smd-input-bg);
 }

 .smd-url-input::placeholder {
     color: #95a5a6;
     direction: ltr;
     text-align: left;
     font-size: 14px;
 }

 .smd-button {
     width: 70%;
     max-width: 400px;
     height: 52px;
     padding: 14px 20px;
     background: linear-gradient(135deg, var(--smd-primary-color) 0%, #6873d8 100%);
     color: white;
     border: none;
     border-radius: 6px !important;
     font-size: 17px;
     font-weight: 600;
     cursor: pointer;
     transition: var(--smd-transition);
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 10px;
     font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
     margin-bottom: 12px;
     margin-left: auto;
     margin-right: auto;
     box-shadow: var(--smd-shadow-sm);
 }

 .smd-button:hover:not(:disabled) {
     background: linear-gradient(135deg, #6873d8 0%, #5a66c9 100%);
     box-shadow: 0 6px 16px rgba(117, 128, 227, 0.25);
 }

 .smd-button:active:not(:disabled) {
     box-shadow: var(--smd-shadow-sm);
 }

 .smd-button:disabled {
     opacity: 0.65;
     cursor: not-allowed;
     transform: none;
     background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
 }
 
 .smd-button:focus {
     outline: none;
     box-shadow: 0 0 0 4px rgba(117, 128, 227, 0.2);
 }

.smd-button.smd-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    animation: smd-shake 0.5s ease;
}

@keyframes smd-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

 .smd-download-loading {
     display: none;
     align-items: center;
     justify-content: center;
     gap: 8px;
 }
 
 .smd-button .smd-download-loading {
     display: flex;
 }

 .smd-spinner {
     width: 18px;
     height: 18px;
     flex-shrink: 0;
     display: inline-block;
     vertical-align: middle;
 }

 .smd-spinner circle {
     transform-origin: center;
     animation: smd-spinner-dash 1.5s ease-in-out infinite, smd-spinner-rotate 2s linear infinite;
 }
 
 .smd-download-loading span {
     line-height: 18px;
     font-size: 17px;
     display: inline-block;
     vertical-align: middle;
     font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
 }
 
 @keyframes smd-spinner-rotate {
     100% {
         transform: rotate(360deg);
     }
 }
 
 @keyframes smd-spinner-dash {
     0% {
         stroke-dasharray: 1, 150;
         stroke-dashoffset: 0;
     }
     50% {
         stroke-dasharray: 90, 150;
         stroke-dashoffset: -35;
     }
     100% {
         stroke-dasharray: 90, 150;
         stroke-dashoffset: -124;
     }
 }

 .smd-text {
     text-align: center;
     color: var(--smd-text-secondary);
     font-size: 13px;
     margin: 0;
     padding: 0;
     font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
     line-height: 1.6;
     transition: var(--smd-transition);
 }

.smd-text.smd-error-text {
    color: #dc2626;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 15px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-top: 10px;
}

/* ====================================
   Half Price Traffic Badge
   ==================================== */
.smd-half-price-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 10px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: var(--smd-shadow-sm);
    transition: var(--smd-transition);
    border: 1px solid rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.smd-half-price-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: smd-shine 3s infinite;
}

@keyframes smd-shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.smd-half-price-badge:hover {
    box-shadow: var(--smd-shadow-lg);
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.5);
}

.smd-half-price-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
}

.smd-half-price-text {
    color: white;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 768px) {
    .smd-half-price-badge {
        height: 28px;
        gap: 6px;
    }
    
    .smd-half-price-icon {
        font-size: 14px;
    }
    
    .smd-half-price-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .smd-half-price-badge {
        height: 26px;
        gap: 5px;
    }
    
    .smd-half-price-icon {
        font-size: 13px;
    }
    
    .smd-half-price-text {
        font-size: 11px;
    }
}

/* ====================================
   Telegram Bot Link
   ==================================== */
.smd-link {
    background: linear-gradient(135deg, #0088cc 0%, #0077b3 100%);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: var(--smd-shadow-sm);
    transition: var(--smd-transition);
}

.smd-link:hover {
    box-shadow: var(--smd-shadow-md);
    transform: translateY(-2px);
}

.smd-link a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    text-decoration: none;
    color: white;
    transition: var(--smd-transition);
}

.smd-link a:hover {
    transform: translateX(5px);
}

.smd-right {
    flex: 1;
}

.smd-right h6 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px 0;
    padding: 0;
    color: white;
    font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
    line-height: 1.5;
}

.smd-right span {
    font-size: 13px;
    color: rgba(255,255,255,0.92);
    display: block;
    font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
}

.smd-link img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ====================================
   Results Section
   ==================================== */
.smd-download-results {
    margin-top: 15px;
}

.smd-download-box {
    padding: 20px 0;
}

.smd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* اگر فقط یک آیتم بود - تک ستونی */
.smd-grid:has(.smd-download-card:only-child) {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* اگر 2+ آیتم بود - حداقل 2 ستونی حتی در موبایل */
.smd-grid:has(.smd-download-card:nth-child(2)) {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.smd-download-card {
    background: var(--smd-bg-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--smd-shadow-md);
    transition: var(--smd-transition);
    border: 1px solid var(--smd-border-color);
}

.smd-download-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--smd-shadow-lg);
    border-color: rgba(117, 128, 227, 0.2);
}

.smd-download-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.smd-responsive-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.smd-download-card:hover .smd-responsive-thumbnail {
    transform: scale(1.05);
}

.smd-download-link {
    display: block;
    padding: 14px 18px;
    text-align: center;
    background: linear-gradient(135deg, var(--smd-primary-color) 0%, #6873d8 100%);
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
    transition: var(--smd-transition);
}

.smd-download-link:hover {
    background: linear-gradient(135deg, #6873d8 0%, #5a66c9 100%);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ====================================
   Description Container and Card Styles
   ==================================== */
.smd-description-container {
    margin-top: 20px;
    width: 100%;
    clear: both;
}

.smd-description-card {
    background: var(--smd-bg-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--smd-shadow-md);
    border: 1px solid var(--smd-border-color);
    transition: var(--smd-transition);
    animation: smd-fade-in 0.5s ease forwards;
}

.smd-description-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--smd-shadow-lg);
    border-color: rgba(117, 128, 227, 0.2);
}

.smd-description-content {
    padding: 20px 24px;
    font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: var(--smd-text-color);
    direction: rtl;
    text-align: right;
}

/* Mixed text direction support */
.smd-description-content * {
    direction: inherit;
}

.smd-description-content h1,
.smd-description-content h2,
.smd-description-content h3,
.smd-description-content h4,
.smd-description-content h5,
.smd-description-content h6 {
    direction: rtl;
    text-align: right;
}

.smd-description-content p {
    direction: rtl;
    text-align: right;
}

/* Enhanced text direction support */
.smd-description-content {
    unicode-bidi: bidi-override;
}

.smd-description-content p,
.smd-description-content div,
.smd-description-content span {
    unicode-bidi: bidi-override;
}

/* Force proper text direction for mixed content */
.smd-description-content * {
    unicode-bidi: bidi-override;
}

/* Specific styling for LTR text with inline styles */
.smd-description-content [dir="ltr"] {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: embed !important;
    display: inline-block;
}

.smd-description-content h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--smd-text-color);
    font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
    line-height: 1.4;
}

.smd-description-content p {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--smd-text-secondary);
}

.smd-description-content p:last-child {
    margin-bottom: 0;
}

.smd-description-link {
    color: var(--smd-primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--smd-transition);
    word-break: break-all;
}

.smd-description-link:hover {
    color: #6873d8;
    text-decoration: underline;
}

/* Pinterest specific styles */
.smd-pinterest-name {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--smd-text-color);
    font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
    line-height: 1.4;
}

.smd-pinterest-description {
    font-size: 14px;
    line-height: 1.7;
    color: var(--smd-text-secondary);
}

/* Twitter specific styles */
.smd-twitter-links {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e6ed;
}

.smd-twitter-links a {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--smd-primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--smd-transition);
    word-break: break-all;
}

.smd-twitter-links a:hover {
    color: #6873d8;
    text-decoration: underline;
}

/* Responsive adjustments for description card */
@media (max-width: 768px) {
    .smd-description-card {
        margin-top: 16px;
        border-radius: 12px;
    }
    
    .smd-description-content {
        padding: 16px 18px;
        font-size: 13px;
    }
    
    .smd-description-content h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .smd-pinterest-name {
        font-size: 16px;
        margin-bottom: 10px;
    }
}

/* ====================================
   Platform Specific Colors
   ==================================== */
.smd-pinterest-wrapper {
    --smd-primary-color: #E60023;
}

.smd-instagram-wrapper {
    --smd-primary-color: #E4405F;
}

.smd-twitter-wrapper {
    --smd-primary-color: #1DA1F2;
}

/* ====================================
   Responsive Design
   ==================================== */
@media (max-width: 768px) {
    .smd-header {
        padding: 24px 15px 16px;
        margin-bottom: 18px;
    }
    
    .smd-title h2 {
        font-size: 24px;
    }
    
    .smd-description p {
        font-size: 14px;
    }
    
    .smd-form {
        padding: 22px 18px;
    }
    
    .smd-url-input {
        height: 50px;
        font-size: 14px;
        padding: 13px 16px;
    }
    
    .smd-button {
        height: 50px;
        font-size: 16px;
        padding: 13px 18px;
    }
    
    .smd-grid {
        gap: 16px;
    }
    
    /* آلبوم - 2 ستونی در تبلت */
    .smd-grid:has(.smd-download-card:nth-child(2)) {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* تکی - 1 ستونی */
    .smd-grid:has(.smd-download-card:only-child) {
        grid-template-columns: 1fr;
    }
    
    .smd-link {
        padding: 16px 18px;
    }
    
    .smd-right h6 {
        font-size: 14px;
    }
    
    .smd-right span {
        font-size: 12px;
    }
    
    .smd-link img {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .smd-wrapper {
        margin: 10px auto;
    }
    
    .smd-container {
        padding: 0 12px;
    }
    
    .smd-header {
        padding: 20px 12px 12px;
        margin-bottom: 16px;
    }
    
    .smd-image img {
        width: 80px;
        height: 80px;
    }
    
    .smd-logo-icon {
        width: 28px;
        height: 28px;
    }
    
    .smd-title {
        margin: 16px 0 8px;
    }
    
    .smd-title h2 {
        font-size: 22px;
    }
    
    .smd-description {
        margin: 8px 0;
    }
    
    .smd-form {
        padding: 18px 8px;
        border-radius: 8px;
    }
    
    .smd-url-input {
        height: 48px;
        font-size: 14px;
        padding: 12px 14px;
        border-radius: 6px !important;
    }
    
    .smd-button {
        width: 80%;
        height: 48px;
        font-size: 15px;
        padding: 12px 16px;
        border-radius: 6px !important;
    }
    
    .smd-link {
        padding: 14px 16px;
        border-radius: 12px;
    }
    
    /* آلبوم - 2 ستونی حتی در موبایل */
    .smd-grid:has(.smd-download-card:nth-child(2)) {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    /* تکی - 1 ستونی در موبایل */
    .smd-grid:has(.smd-download-card:only-child) {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
}

/* ====================================
   Force Light Mode (No Dark Mode)
   ==================================== */
@media (prefers-color-scheme: dark) {
    .smd-wrapper {
        color-scheme: light;
        /* همه رنگ‌ها روشن باقی می‌مانند */
    }
}

/* ====================================
   Loading State
   ==================================== */
.smd-download-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.smd-spinner {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smd-spinner circle {
    transform-origin: center;
    animation: smd-spinner-dash 1.5s ease-in-out infinite, smd-spinner-rotate 2s linear infinite;
}

.smd-download-loading span {
    line-height: 18px;
    font-size: 17px;
    display: flex;
    align-items: center;
    font-family: 'Yekan_Bakh', Tahoma, Arial, sans-serif;
}

/* ====================================
   Animation
   ==================================== */
@keyframes smd-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes smd-spinner-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes smd-spinner-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.smd-download-card {
    animation: smd-fade-in 0.5s ease forwards;
}

.smd-download-card:nth-child(1) { animation-delay: 0.1s; }
.smd-download-card:nth-child(2) { animation-delay: 0.2s; }
.smd-download-card:nth-child(3) { animation-delay: 0.3s; }
.smd-download-card:nth-child(4) { animation-delay: 0.4s; }

/* ====================================
   Utility Classes
   ==================================== */
.smd-hide {
    display: none !important;
}

.smd-show {
    display: block !important;
}

/* ====================================
   Print Styles
   ==================================== */
@media print {
    .smd-form,
    .smd-link {
        display: none;
    }
}

