:root {
    --bg: #0f172a;
    --glass: rgba(30, 41, 59, 0.85);
    --primary: #6366f1;
    --secondary: #ec4899;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --warning: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --border: rgba(255,255,255,0.1);
}

* { box-sizing: border-box; font-family: 'Vazirmatn', sans-serif; }

body {
    background: var(--bg);
    background-image: radial-gradient(at 0% 0%, rgba(99,102,241,0.15), transparent 50%), 
                      radial-gradient(at 100% 100%, rgba(236,72,153,0.15), transparent 50%);
    background-attachment: fixed;
    color: var(--text);
    margin: 0;
    padding: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header & Updates */
.header-bar {
    width: 100%; max-width: 550px; display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 15px; padding: 0 10px; margin-top: 10px;
}
.app-title { font-weight: bold; color: var(--primary); font-size: 1.1rem; }
.version-badge { font-size: 0.75rem; background: rgba(255,255,255,0.1); padding: 5px 10px; border-radius: 8px; cursor: pointer; transition: 0.2s; }
.version-badge:hover { background: var(--primary); color: white; }

/* Install Button */
#installBtn { 
    position: fixed; top: 15px; left: 15px; background: var(--success); color: white; border: none; 
    padding: 8px 15px; border-radius: 20px; cursor: pointer; display: none; z-index: 100; 
    font-size: 0.85rem; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: 0.3s;
}
#installBtn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4); }

/* Main Container */
.container {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px;
    width: 100%; max-width: 550px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    margin-bottom: 20px;
}

h2 { text-align: center; margin: 0 0 15px 0; font-weight: 800; font-size: 1.4rem; }

/* Tabs */
.tabs { display: flex; background: rgba(0,0,0,0.3); padding: 4px; border-radius: 14px; margin-bottom: 15px; }
.tab-btn { flex: 1; padding: 10px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 10px; transition: 0.3s; font-weight: bold; font-size: 0.9rem; }
.tab-btn.active.enc { background: var(--primary); color: white; }
.tab-btn.active.dec { background: var(--secondary); color: white; }

/* Forms */
.form-group { margin-bottom: 12px; }
label { display: block; margin-bottom: 6px; color: #cbd5e1; font-size: 0.85rem; font-weight: 500; }

input:not([type="checkbox"]), textarea, select {
    width: 100%; padding: 12px; background: rgba(0,0,0,0.25); border: 1px solid var(--border);
    border-radius: 12px; color: white; font-size: 1rem; transition: 0.3s; appearance: none;
}
input:not([type="checkbox"]):focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); background: rgba(0,0,0,0.4); }

/* Password Field */
.pass-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.pass-header label { margin: 0; }
.password-wrapper { position: relative; width: 100%; }
.password-wrapper input { padding-left: 40px; }
.password-toggle {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); cursor: pointer; padding: 5px; font-size: 0.9rem; z-index: 10;
}
.gen-pass-btn { float: left; font-size: 0.75rem; color: var(--secondary); cursor: pointer; font-weight: bold; display: flex; align-items: center; gap: 5px; transition: 0.2s; }
.gen-pass-btn:hover { color: #f472b6; }

/* Strength Meter */
.strength-bar { height: 4px; background: rgba(255,255,255,0.1); margin-top: 5px; border-radius: 2px; overflow: hidden; }
.strength-fill { height: 100%; width: 0%; transition: width 0.3s; }
.strength-info { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 0.75rem; }
.strength-text { font-weight: bold; color: #64748b; }
.crack-time { color: var(--text-muted); font-size: 0.7rem; }

/* Helper Classes */
.checkbox-wrapper { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.05); padding: 10px; border-radius: 12px; border: 1px solid var(--border); margin-top: 10px; cursor: pointer; }
input[type="checkbox"] { width: 20px; height: 20px; margin: 0; cursor: pointer; accent-color: var(--primary); appearance: auto; }
.checkbox-label { font-size: 0.85rem; color: #cbd5e1; cursor: pointer; margin: 0; }

.smart-suggestion { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); border-radius: 10px; padding: 10px; font-size: 0.8rem; color: #a7f3d0; margin-bottom: 15px; display: none; }
.suggestion-tag { font-weight: bold; color: white; background: var(--success); padding: 2px 6px; border-radius: 4px; margin: 0 2px; }

#coverTextInput { display: none; animation: fadeIn 0.3s; }
.hint-text { font-size: 0.7rem; color: #94a3b8; margin-top: 4px; }

/* Main Button */
.btn-main { width: 100%; padding: 14px; border: none; border-radius: 14px; font-size: 1rem; font-weight: bold; cursor: pointer; color: white; margin-top: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); transition: 0.2s; }
.btn-main:active { transform: scale(0.98); }
.btn-enc { background: linear-gradient(135deg, var(--primary), #4338ca); }
.btn-dec { background: linear-gradient(135deg, var(--secondary), #be185d); }
.btn-main:disabled { background: #64748b; cursor: not-allowed; opacity: 0.7; }

/* Result Area */
.result-container { margin-top: 20px; display: none; }
.stats-box { font-size: 0.8rem; color: #94a3b8; margin-bottom: 5px; display: flex; justify-content: space-between; }
.result-part { background: rgba(15, 23, 42, 0.6); border: 1px dashed var(--border); border-radius: 12px; padding: 15px; margin-bottom: 10px; position: relative; }
.copy-btn { position: absolute; left: 10px; top: 10px; background: rgba(255,255,255,0.1); color: var(--text-muted); border: 1px solid var(--border); padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 0.75rem; transition: 0.2s; }
.copy-btn:hover { background: var(--primary); color: white; }
.result-text { word-wrap: break-word; font-size: 0.9rem; color: #e2e8f0; line-height: 1.8; margin-top: 25px; }

/* Info & Guide */
.info-container { width: 100%; max-width: 550px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
details { background: rgba(30, 41, 59, 0.5); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
summary { padding: 12px; cursor: pointer; font-weight: bold; font-size: 0.9rem; color: var(--text-muted); list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::after { content: '+'; font-size: 1.2rem; }
details[open] summary::after { content: '-'; }
.info-content { padding: 15px; font-size: 0.85rem; color: #cbd5e1; line-height: 1.8; border-top: 1px solid var(--border); }

/* NEW ELEMENTS */
.method-info {
    background: rgba(59, 130, 246, 0.15);
    border-left: 4px solid #3b82f6;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #bfdbfe;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s;
}

.warning-box {
    background: rgba(239, 68, 68, 0.15);
    border-left: 4px solid #ef4444;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pulse 2s infinite;
}

.part-label {
    display: block;
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
    width: fit-content;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.info-content ul, .info-content ol { padding-right: 20px; margin: 10px 0; }
.info-content li { margin-bottom: 8px; }