:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --info-color: #4895ef;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --bg-light: #f8fafc;
    --bg-dark: #212529;
    --card-light: #ffffff;
    --card-dark: #2c3034;
    --text-light: #333333;
    --text-dark: #f1f1f1;
    --border-light: rgba(0,0,0,0.08);
    --border-dark: #3d4145;
}

body {
    font-family: var(--font-family, 'Poppins', sans-serif);
    background-color: var(--bg-light);
    color: var(--text-light);
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dark-mode {
    background-color: var(--bg-dark) !important;
    color: var(--text-dark) !important;
}

.dark-mode .section {
    background-color: var(--card-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

.dark-mode .password-card {
    background-color: var(--card-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

.dark-mode .password-input {
    background-color: #343a40;
    color: var(--text-dark);
    border-color: var(--border-dark);
}

.dark-mode .form-control,
.dark-mode .form-select {
    background-color: #343a40;
    color: var(--text-dark);
    border-color: var(--border-dark);
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
    background-color: #343a40;
    color: var(--text-dark);
    border-color: var(--primary-color);
}

.dark-mode .text-muted {
    color: #adb5bd !important;
}

.dark-mode .domain-box {
    background-color: #343a40;
    color: var(--text-dark);
}

.dark-mode .password-suggestion {
    background-color: #343a40;
    color: var(--text-dark);
}

.dark-mode .example {
    background-color: #495057;
    color: var(--text-dark);
}

header, footer {
    background-color: var(--dark-color);
    color: white;
}

.logo {
    max-width: 180px;
    display: block;
    margin: 0 auto;
}

.section {
    background: var(--card-light);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.section:hover {
    box-shadow: 0 6px 25px rgba(0,0,0,0.08);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid #e9ecef;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dark-mode .section-title {
    border-bottom-color: #495057;
}

.password-card {
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    background-color: var(--card-light);
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

.password-card:hover {
    border-color: rgba(0,0,0,0.12);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.password-input-group {
    position: relative;
    margin-bottom: 1rem;
}

.password-input {
    padding-right: 70px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    height: 50px;
    border-radius: 0.5rem !important;
    background-color: #f8f9fa;
    direction: ltr;
    text-align: left;
}

.password-actions {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 5;
}

.btn-action {
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.btn-copy {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-copy:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

.btn-toggle {
    background-color: #6c757d;
    color: white;
    border: none;
}

.btn-toggle:hover {
    background-color: #5a6268;
    transform: scale(1.05);
}

.strength-bar-container {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.dark-mode .strength-bar-container {
    background-color: #495057;
}

.strength-bar {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 0.5s ease, background-color 0.5s ease;
}

.strength-text {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qr-container {
    text-align: center;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    display: block;
    margin: 0 auto;
    width: 200px;
    margin-top: 10px;
}

.dark-mode .qr-container {
    background-color: #343a40;
}

.qr-container img, canvas {
    cursor: zoom-in;
    width: 100px;
    height: 100px;
    transition: transform 0.3s ease;
}

.qr-container img:hover, canvas:hover {
    transform: scale(1.05);
}

.qr-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.share-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed #dee2e6;
}

.dark-mode .share-section {
    border-top-color: #495057;
}

.share-title {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.share-btn:hover {
    transform: scale(1.1);
}

.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.15em;
    border-radius: 50% !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.form-check-label:hover {
    color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.action-buttons .btn {
    flex: 1 1 auto;
    min-width: 160px;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-buttons .btn:hover {
    transform: translateY(-1px);
}

.password-suggestion {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 4px solid var(--primary-color);
}

.password-suggestion h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.password-suggestion p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-align: justify;
}

.password-suggestion .example {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background-color: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
}

.badge-info {
    background-color: var(--info-color);
    font-weight: 500;
    padding: 0.5em 1em;
    font-size: 0.9rem;
}

.theme-toggle {
    cursor: pointer;
    font-size: 1.5rem;
    margin: 0 10px;
    color: white;
    background-color: rgba(255,255,255,0.1);
    padding: 5px 10px;
    border-radius: 5px;
    position: relative;
}

.theme-toggle:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.flag-box {
    background-color: rgba(255,255,255,0.1);
    padding: 10px 5px 5px 10px;
    border-radius: 5px;
    flex-direction: column;
    gap: 0px;
}

.flag-box a {
    transition: transform 0.3s;
    padding: 0 5px 0 0;
}

.flag-box a:hover {
    transform: scale(1.1);
}

.header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.header-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.header-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.header-links a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 5px 4px;
}

footer img {
    max-width: 120px;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    text-align: right; /* تغییر داده شد */
}

.footer-column-title {
    font-weight: bold;
    margin-bottom: 15px;
    color: #fff;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    color: #adb5bd;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-copyright {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.social-links a i {
    font-size: 1.5rem;
    margin: 0 5px;
    transition: transform 0.3s;
}

.social-links a:hover i {
    transform: scale(1.2);
}

.bi-telegram {
    color: #0088cc !important;
}
.bi-instagram {
    color: #e1306c !important;
}
.bi-twitter-x {
    color: #1da1f2 !important;
}
.bi-telephone {
    color: #28a745 !important;
}
.bi-envelope {
    color: #17a2b8 !important;
}

/* Responsive styles */
@media (min-width: 768px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    .logo {
        margin: 0;
    }
    .header-controls {
        margin-top: 0;
        justify-content: flex-end;
    }
    .header-links {
        margin-top: 0;
        justify-content: flex-end; /* تغییر داده شد */
    }
}

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

@media (max-width: 768px) {
    .footer-columns {
        grid-template-columns: 1fr;
    }
    .footer-links {
        flex-direction: column;
        align-items: right; /* تغییر داده شد */
    }
    .footer-links a {
        margin: 0 0 10px 0;
    }
    .footer-copyright {
        flex-direction: column;
        text-align: center;
    }
    .footer-copyright img {
        margin-bottom: 15px;
    }
    
    .password-actions {
        position: static;
        transform: none;
        margin-top: 0.5rem;
        justify-content: flex-start;
    }
    
    .password-input {
        padding-right: 1rem;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    /* بهبود دکمه‌های اشتراک‌گذاری در موبایل */
    .share-buttons-mobile {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
    
    .share-buttons-mobile .btn {
        flex: 1;
        min-width: 60px;
    }

    /* چیدمان بهتر برای دکمه اصلی */
    .generate-main-btn {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .generate-secondary {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

.modal-content {
    border: none;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.dark-mode .modal-content {
    background-color: var(--card-dark);
    color: var(--text-dark);
}

.modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

.modal-footer {
    border-top: none;
    justify-content: center;
}

/* انیمیشن برای مودال */
.modal.fade .modal-dialog {
    transform: translateY(-50px);
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: translateY(0);
}

.modal-img {
    max-width: 100%;
    height: auto;
    width: 300px;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.domain-box {
    background-color: #f5f6f7;
    padding: 10px 20px;
    border-radius: 5px;
    display: inline-block;
    margin: 15px 0;
    width: 100%;
}

@media (max-width: 768px) {
    .social-links {
        display: flex;
        justify-content: center;
        gap: 15px;
    }
}

/* استایل‌های جدید برای دکمه اصلی */
.generate-btn-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.main-generate-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 0.75rem;
    color: white;
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.main-generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.5);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.main-generate-btn:active {
    transform: translateY(-1px);
}

.secondary-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 768px) {
    .secondary-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .main-generate-btn {
        order: -1;
    }
}
/* هدر و فوتر در حالت شب */
.dark-mode header,
.dark-mode footer {
    background-color: #1a1d23 !important;
    border-bottom: 1px solid #2d3239;
}

.dark-mode footer {
    border-top: 1px solid #2d3239;
}

/* باکس مثال در حالت شب */
.dark-mode .example {
    background-color: #495057;
    color: #f8f9fa !important;
}

/* دکمه X (توییتر) در حالت شب */
.dark-mode .btn-outline-dark {
    color: #f8f9fa !important;
    border-color: #6c757d !important;
}

.dark-mode .btn-outline-dark:hover {
    background-color: #6c757d !important;
    color: #fff !important;
}

/* تراز دکمه‌های تاریخچه در موبایل */
@media (max-width: 768px) {
    .history-actions {
        display: flex;
        justify-content: center !important;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .history-actions .btn {
        flex: 1;
        min-width: 140px;
        max-width: 200px;
    }
}

/* استایل برای آیتم‌های تاریخچه */
.history-item {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.dark-mode .history-item {
    background-color: #2c3034;
    border-color: #3d4145;
    color: #f1f1f1;
}

.history-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.history-password {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background-color: #e9ecef;
    padding: 0.5rem;
    border-radius: 0.25rem;
    margin: 0.5rem 0;
    direction: ltr;
    text-align: left;
}

.dark-mode .history-password {
    background-color: #495057;
    color: #f8f9fa;
}

.history-meta {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dark-mode .history-meta {
    color: #adb5bd;
} 
/* استایل برای کارت‌های آمار */
.stats-card {
    text-align: center;
    padding: 1.5rem 1rem;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stats-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stats-card small {
    font-size: 0.85rem;
}

/* پیش‌نمایش رمز */
.password-preview {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

#previewText {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* تنظیمات پیشرفته */
.advanced-options {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--info-color);
}

.dark-mode .advanced-options {
    background-color: #2c3034;
}

/* اضافه کردن استایل برای RTL و LTR */
[dir="rtl"] .footer-columns,
[dir="rtl"] .footer-links {
    text-align: right;
}

[dir="ltr"] .footer-columns,
[dir="ltr"] .footer-links {
    text-align: left;
}

[dir="rtl"] .header-links {
    justify-content: flex-end;
}

[dir="ltr"] .header-links {
    justify-content: flex-start;
}
/* استایل برای تاریخچه در موبایل */
.history-meta {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dark-mode .history-meta {
    color: #adb5bd;
}

.history-timestamp {
    word-break: break-word;
}

.history-strength {
    font-weight: 500;
}

/* در دسکتاپ به صورت افقی نمایش داده شود */
@media (min-width: 768px) {
    .history-meta {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* در موبایل به صورت عمودی */
@media (max-width: 767px) {
    .history-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .history-timestamp, .history-strength {
        width: 100%;
    }
}












/* استایل جدید برای انتخاب زبان */
.language-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    min-width: 80px;
    justify-content: center;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.4);
}

.lang-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.lang-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

.lang-text {
    font-weight: 500;
}



/* استایل دکمه حالت شب/روز هماهنگ با انتخاب زبان */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.theme-toggle-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.4);
}

.theme-toggle-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* برای موبایل */
@media (max-width: 768px) {
    .theme-toggle-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* حالت فعال */
.theme-toggle-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}







/* استایل container کنترل‌ها */
.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* برای موبایل */
@media (max-width: 768px) {
    .header-controls {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .language-selector {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .theme-toggle-btn {
        order: 1;
    }
}






/* استایل نهایی برای هدر در موبایل */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-links {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .header-controls {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .logo {
        order: 1;
        margin-bottom: 10px;
    }
    
    .lang-text {
        display: inline; /* در موبایل هم متن نمایش داده شود */
    }
    
    .lang-btn {
        min-width: 90px;
        padding: 8px 12px;
    }
}