/* 3omar.hs Password Generator & Hash Vault Styling */

:root {
    --primary: #ef4444;
    --primary-hover: #dc2626;
    --secondary: #8b5cf6;
    --accent: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --glow-red: 0 0 20px rgba(239, 68, 68, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(239, 68, 68, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Navbar */
.navbar {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.back-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-3px);
}

html[dir="rtl"] .back-link:hover {
    transform: translateX(3px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ef4444, #8b5cf6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: var(--glow-red);
}

.brand-text {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.lang-selector {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.lang-selector:hover {
    border-color: var(--primary);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.6; }
    100% { transform: scale(0.95); opacity: 1; }
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 30%, #fca5a5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 720px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

/* Stats Ribbon */
.stats-ribbon {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-val {
    color: #fff;
    font-weight: 700;
}

/* Main Tabbed Layout */
.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(139, 92, 246, 0.2));
    border-color: var(--primary);
    color: #fff;
    box-shadow: var(--glow-red);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Card Boxes */
.card-box {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.card-title-group {
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.4rem;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Password Display Field */
.pass-display-box {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.pass-display-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #ef4444, #8b5cf6);
}

.pass-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.05em;
    word-break: break-all;
    user-select: all;
}

.action-btn-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: var(--glow-red);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Control Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.option-group {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: var(--radius-md);
}

.option-group-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.range-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.range-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.range-val {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}

/* Checkbox Toggle List */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    color: var(--text-main);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.text-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.text-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

textarea.text-input {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

/* Strength & Entropy Meter */
.strength-meter-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.strength-bar-bg {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin: 0.75rem 0;
}

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

.strength-metrics {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Batch Password Table */
.batch-output {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.9rem;
    margin: 1rem 0;
    line-height: 1.6;
}

/* Encryption / Decryption Grid */
.enc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .enc-grid {
        grid-template-columns: 1fr;
    }
}

/* Hash output list */
.hash-item {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.hash-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

.hash-val-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.hash-val {
    font-family: monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
    word-break: break-all;
}

/* Drag and Drop Zone */
.drop-zone {
    border: 2px dashed rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(239, 68, 68, 0.12);
}

.drop-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* Matcher Alert Box */
.matcher-alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    margin-top: 1rem;
    display: none;
}

.matcher-alert.success {
    display: block;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #34d399;
}

.matcher-alert.error {
    display: block;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

/* RSA Pre Box */
.rsa-code-box {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: monospace;
    font-size: 0.8rem;
    color: #4ade80;
    max-height: 220px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin-top: 0.5rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--primary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--glow-red);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}

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

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-20px); }
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
}
