/* 
    K1 CHAT - Premium Mobile Design System
    Focus: Glassmorphism, Vibrance, Smooth Transitions
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.3);
    --secondary: #a855f7;
    --accent: #22d3ee;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --safe-area-top: env(safe-area-inset-top, 20px);
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #020617; /* Darker outer background */
    color: var(--text-main);
    overflow-x: hidden;
    margin: 0;
    display: flex;
    justify-content: center; /* Center the mobile container */
    min-height: 100vh;
}



/* Background Gradients */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: blob-float 20s infinite alternate;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -100px;
    right: -50px;
}

.blob-2 {
    width: 250px;
    height: 250px;
    background: var(--secondary);
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

@keyframes blob-float {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(30px, 50px) scale(1.1); }
}

/* Layout Shell */
.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 500px; /* Fixed mobile width */
    width: 100%;
    margin: 0 auto;
    background-color: var(--bg-dark);
    position: relative;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.5);
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}



/* Glass Components */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
}

/* Header */
header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-container img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* Forms */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.glass-input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 14px 18px;
    border-radius: 14px;
    color: white;
    outline: none;
    transition: all 0.3s ease;
}

.glass-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px; /* Match app-container */
    height: calc(70px + var(--safe-area-bottom));
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    padding-bottom: var(--safe-area-bottom);
    z-index: 1000;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
}

.tab-item.active {
    color: var(--primary);
}

.tab-item i {
    font-size: 1.4rem;
}

.tab-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Chat Bubbles */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.4;
}

.message.received {
    align-self: flex-start;
    background: var(--bg-card);
    border-bottom-left-radius: 4px;
}

.message.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-bottom-right-radius: 4px;
}

.message-meta {
    font-size: 0.7rem;
    margin-top: 4px;
    opacity: 0.6;
}

/* Premium Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Glass Card Hover */
.glass-panel {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Smooth Tab Bar */
.tab-bar .tab-item {
    transition: all 0.3s ease;
}
.tab-bar .tab-item i {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.tab-bar .tab-item.active i {
    transform: translateY(-5px);
    color: var(--primary);
}

/* Global Modal System */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.modal-overlay.active { display: flex; }
.modal-content {
    width: 90%;
    max-width: 320px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 32px;
    padding: 30px;
    text-align: center;
    animation: modalIn 0.3s ease-out;
}
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-avatar { width: 100px; height: 100px; border-radius: 32px; margin-bottom: 20px; border: 3px solid var(--primary); }
.modal-name { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.modal-status { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 25px; }
.modal-actions { display: flex; gap: 15px; justify-content: center; }
.modal-action-btn { 
    width: 50px; height: 50px; border-radius: 18px; 
    background: var(--glass-bg); color: white;
    display: flex; align-items: center; justify-content: center; 
    font-size: 1.2rem; cursor: pointer; border: none; outline: none;
    transition: all 0.2s; padding: 0;
}
.modal-action-btn:active { transform: scale(0.9); background: rgba(255,255,255,0.2); }

