/* style.css - استایل کامل سیستم */

/* تنظیمات پایه */
:root {
    --primary: #6d28d9;
    --primary-dark: #5b21b6;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --light: #f8fafc;
    --gray-100: #f3f4f6;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

/* ======== دکمه تغییر زبان ======== */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

[dir="ltr"] .language-switcher {
    left: 20px;
    right: auto;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

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

.lang-btn i {
    font-size: 1rem;
}

.current-lang {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ======== هدر ======== */
.header {
    background: var(--gradient);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

.logo {
    font-size: 3.5rem;
    margin-bottom: 15px;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 800;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 25px;
    line-height: 1.6;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.15);
    padding: 8px 15px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.stat i {
    font-size: 1rem;
}

/* ======== سوئیچ حالت ======== */
.mode-switcher {
    display: flex;
    padding: 20px;
    background: var(--light);
    border-bottom: 1px solid var(--gray-300);
}

.switch-btn {
    flex: 1;
    padding: 16px;
    font-size: 1.1rem;
    border: 2px solid var(--gray-300);
    background: white;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
}

[dir="rtl"] .switch-btn:first-child {
    border-radius: 10px 0 0 10px;
    border-right: none;
}

[dir="rtl"] .switch-btn:last-child {
    border-radius: 0 10px 10px 0;
}

[dir="ltr"] .switch-btn:first-child {
    border-radius: 0 10px 10px 0;
    border-left: none;
}

[dir="ltr"] .switch-btn:last-child {
    border-radius: 10px 0 0 10px;
}

.switch-btn:hover {
    background: #f3f4f6;
}

.switch-btn.active {
    background: var(--gradient);
    color: white;
    border-color: var(--primary);
}

/* ======== هشدارها ======== */
.alert {
    margin: 20px 30px;
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

[dir="rtl"] .alert.error {
    border-right: 4px solid #dc2626;
}

[dir="ltr"] .alert.error {
    border-left: 4px solid #dc2626;
}

/* ======== محتوای اصلی ======== */
.content {
    padding: 30px;
    min-height: 400px;
}

.form-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-section.active {
    display: block;
}

/* ======== فرم‌ها ======== */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

textarea, input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    font-size: 1rem;
    resize: vertical;
    min-height: 140px;
    font-family: inherit;
    transition: border 0.3s;
    background: white;
}

textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
}

[dir="rtl"] .input-icon {
    right: 15px;
}

[dir="ltr"] .input-icon {
    left: 15px;
}

/* ======== اطلاعات فرم ======== */
.form-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--info);
}

[dir="rtl"] .form-info {
    border-right: 4px solid var(--info);
}

[dir="ltr"] .form-info {
    border-left: 4px solid var(--info);
}

/* ======== دکمه‌ها ======== */
.btn-submit, .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-submit {
    background: var(--gradient);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(109, 40, 217, 0.3);
}

/* ======== نتایج ======== */
.result-box {
    margin-top: 20px;
    padding: 25px;
    background: #f9fafb;
    border-radius: 15px;
    border: 2px solid #e5e7eb;
    text-align: center;
}

.result-box.show {
    display: block;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-icon {
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 15px;
}

.result-box h2 {
    color: var(--dark);
    margin-bottom: 20px;
    font-size: 1.6rem;
}

.code-display-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px solid #e5e7eb;
}

.code-display {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-dark);
    letter-spacing: 6px;
    padding: 15px;
    margin: 15px 0;
    background: #f5f3ff;
    border-radius: 10px;
    border: 2px solid var(--primary);
    font-family: 'Courier New', monospace;
}

.btn-copy {
    padding: 10px 25px;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

/* ======== کارت اطلاعات ======== */
.info-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px solid #e5e7eb;
}

.info-card h3, .info-card h4 {
    color: var(--dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

[dir="rtl"] .info-card {
    border-right: 4px solid var(--info);
}

[dir="ltr"] .info-card {
    border-left: 4px solid var(--info);
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card li:last-child {
    border-bottom: none;
}

.info-card li i {
    color: var(--secondary);
}

/* ======== شمارنده ======== */
.view-counter {
    background: #ecfdf5;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #059669;
    border: 2px solid #10b981;
    font-weight: 600;
}

/* ======== کارت پیام ======== */
.message-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.message-header {
    padding: 20px;
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
}

.message-info h3 {
    color: var(--dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.message-content {
    padding: 25px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--dark);
    background: #fafafa;
    min-height: 150px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-footer {
    padding: 15px 20px;
    background: #fef2f2;
}

.warning-note {
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

/* ======== دکمه‌های اکشن ======== */
.action-buttons {
    margin-top: 25px;
}

/* ======== فوتر ======== */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--gray-500);
    border-top: 1px solid #e5e7eb;
    font-size: 0.9rem;
    background: var(--light);
}

/* ======== نوتیفیکیشن ======== */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: notificationIn 0.3s ease;
}

@keyframes notificationIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.notification.success {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
}

.notification.hide {
    animation: notificationOut 0.3s ease;
}

@keyframes notificationOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* ======== ریسپانسیو ======== */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .logo {
        font-size: 3rem;
    }
    
    .language-switcher {
        position: relative;
        top: 0;
        right: 0;
        left: 0;
        margin: 15px auto;
        text-align: center;
    }
    
    .lang-btn {
        margin: 0 auto;
        display: inline-flex;
    }
    
    .stats-bar {
        gap: 10px;
    }
    
    .stat {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .mode-switcher {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .switch-btn {
        width: 100%;
        border-radius: 10px !important;
        border: 2px solid var(--gray-300) !important;
    }
    
    .content {
        padding: 20px;
    }
    
    .code-display {
        font-size: 1.8rem;
        letter-spacing: 4px;
        padding: 10px;
    }
    
    .message-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    textarea, input[type="text"] {
        padding: 12px;
        min-height: 120px;
    }
    
    .btn-submit, .btn-primary {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .code-display {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
    
    .message-content {
        font-size: 1rem;
        padding: 15px;
    }
}