/* QickLink - Main Stylesheet */
/* QickLink को मुख्य style file */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #534AB7;
    --primary-dark: #3C3489;
    --success: #1D9E75;
    --danger: #E24B4A;
    --warning: #BA7517;
    --bg: #f8f8fc;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6b6b8a;
    --border: rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
}

/* Container - सबै pages को main container */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    min-height: 100vh;
}

/* Brand header */
.brand {
    text-align: center;
    padding: 2rem 0 1.5rem;
}

.brand-logo {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.brand-logo svg {
    width: 36px;
    height: 36px;
}

.brand-tagline {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Card - सबै cards को style */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

/* Buttons - सबै buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(83, 74, 183, 0.08);
}

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

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

.btn-sm {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
}

/* Step indicator - setup steps देखाउने */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s;
}

.step-dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

.step-dot.done {
    background: var(--success);
}

/* Input fields */
input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: 15px;
    color: var(--text);
    background: white;
    outline: none;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
}

/* Link display box */
.link-box {
    background: #f0f0f8;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-family: monospace;
    font-size: 13px;
    color: var(--primary-dark);
    word-break: break-all;
    border: 1px solid rgba(83,74,183,0.2);
    user-select: all;
}

/* Password display */
.pw-box {
    background: #f8f8fc;
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 3px;
    text-align: center;
    border: 1.5px dashed rgba(83,74,183,0.3);
}

/* Timer */
.timer {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.timer strong {
    color: var(--warning);
    font-weight: 700;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #e8f8f3; color: var(--success); }
.badge-warning { background: #fef8ed; color: var(--warning); }
.badge-danger { background: #fef0f0; color: var(--danger); }
.badge-info { background: #eeeeff; color: var(--primary); }

/* Info rows */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); }
.info-value { font-weight: 600; }

/* ==========================================
   CHAT PAGE STYLES
   Chat page को styles
   ========================================== */

/* Chat layout */
.chat-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: white;
}

/* Chat header */
.chat-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.partner-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.partner-name { font-weight: 600; font-size: 15px; }

.partner-status {
    font-size: 12px;
    color: var(--text-muted);
}

.partner-status.online { color: var(--success); }

/* Chat messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8f8fc;
}

/* Individual message bubble */
.msg-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.msg-bubble.mine {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.msg-bubble.theirs {
    background: white;
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

.msg-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}

.msg-wrapper {
    display: flex;
    flex-direction: column;
}

.msg-wrapper.mine { align-items: flex-end; }
.msg-wrapper.theirs { align-items: flex-start; }

/* Typing indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    border: 1px solid var(--border);
    width: fit-content;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.2s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* Chat input area */
.chat-input-area {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: white;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 24px;
    border: 1.5px solid var(--border);
    font-size: 14px;
    outline: none;
    resize: none;
    max-height: 120px;
    font-family: inherit;
}

.chat-input:focus { border-color: var(--primary); }

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.send-btn:hover { background: var(--primary-dark); }

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

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

/* Voice call overlay */
.call-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(83,74,183,0.97);
    color: white;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    z-index: 100;
}

.call-overlay.active { display: flex; }

.call-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
}

.call-status-text {
    font-size: 16px;
    opacity: 0.8;
}

.call-buttons {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.call-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.2s;
}

.call-btn:active { transform: scale(0.9); }
.call-btn-end { background: var(--danger); }
.call-btn-mute { background: rgba(255,255,255,0.2); }

/* Security info bar */
.security-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    background: #e8f8f3;
    font-size: 11px;
    color: var(--success);
    font-weight: 600;
}

/* Device fingerprint display */
.fp-display {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-muted);
    background: #f0f0f8;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    word-break: break-all;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(83,74,183,0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Alert messages */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 1rem;
}

.alert-error { background: #fef0f0; color: var(--danger); border: 1px solid rgba(226,75,74,0.2); }
.alert-success { background: #e8f8f3; color: var(--success); border: 1px solid rgba(29,158,117,0.2); }
.alert-info { background: #eeeeff; color: var(--primary); border: 1px solid rgba(83,74,183,0.2); }

/* System message in chat */
.sys-msg {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 12px;
    background: rgba(0,0,0,0.05);
    border-radius: 20px;
    align-self: center;
}

/* Responsive */
@media (max-width: 480px) {
    .container { padding: 1rem 0.75rem; }
}
