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

:root {
    --bg-dark: #070913;
    --bg-gradient: linear-gradient(135deg, #090c22 0%, #15092a 50%, #060814 100%);
    --card-bg: rgba(15, 18, 38, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --primary: #ec4899;
    --primary-gradient: linear-gradient(90deg, #ec4899 0%, #a855f7 100%);
    --primary-glow: rgba(236, 72, 153, 0.3);
    --secondary: #6366f1;
    --secondary-gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    --accent-gold: #f59e0b;
    --danger: #ef4444;
    --success: #10b981;
    
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* Prevent the entire page from scrolling up/down */
}

body {
    background-color: var(--bg-dark);
    background-image: var(--bg-gradient);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100dvh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mobile Wrapper Shell (Centered mock phone frame on desktop, fullscreen on mobile) */
.app-container {
    width: 100%;
    max-width: 440px;
    height: 100dvh; /* Strict viewport height fit */
    max-height: 100dvh;
    background: rgba(10, 11, 28, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 
                0 0 40px rgba(236, 72, 153, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
    }
}

/* Header Navbar Styles */
.app-header {
    padding: 16px 20px;
    background: rgba(13, 16, 37, 0.8);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.app-header h1 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.logout-btn:hover {
    color: var(--danger);
}

/* App Main Content Area */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 110px 20px; /* 110px bottom padding to clear the higher floating navigation bar */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-content.chat-mode {
    padding: 0;
    justify-content: flex-start;
}

/* Auth Screens Styling */
.auth-title-container {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    width: 70px;
    height: 70px;
    background: var(--primary-gradient);
    border-radius: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 16px;
    font-size: 2.2rem;
    box-shadow: 0 10px 20px var(--primary-glow);
    animation: pulseLogo 3s infinite alternate;
}

@keyframes pulseLogo {
    0% { transform: scale(1); box-shadow: 0 10px 20px var(--primary-glow); }
    100% { transform: scale(1.05); box-shadow: 0 15px 25px rgba(236, 72, 153, 0.5); }
}

.auth-title-container h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.auth-title-container p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.4;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.form-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px 16px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.25s ease;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
    background: rgba(15, 23, 42, 0.85);
}

.btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 15px 20px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 16px var(--primary-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(236, 72, 153, 0.45);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Premium Navigation Tab Bar */
.app-nav {
    position: fixed;
    bottom: 30px; /* Moved higher to prevent cutoff by mobile browser navigation bars */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 408px; /* Matches the centered 440px phone container minus margins */
    display: flex;
    background: linear-gradient(135deg, rgba(28, 13, 44, 0.8) 0%, rgba(13, 10, 33, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(236, 72, 153, 0.25); /* Elegant glowing pink border */
    border-radius: 24px; /* Pill shaped design */
    padding: 12px 0;
    z-index: 1000;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 
                0 0 25px rgba(236, 72, 153, 0.15); /* Pink drop glow matches Sneha AI theme */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.2s ease;
    cursor: pointer;
}

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

.nav-icon {
    font-size: 1.3rem;
}

/* Chat Iframe Wrapper & Expiration Overlay */
.chat-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
}

.expired-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 8, 20, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px;
    z-index: 999;
}

.expired-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: rotateWarning 2s ease infinite alternate;
}

@keyframes rotateWarning {
    0% { transform: scale(1) rotate(0); }
    100% { transform: scale(1.1) rotate(5deg); }
}

.expired-overlay h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.expired-overlay p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Plans & Billing Styling */
.plans-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.plan-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.plan-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: scale(1.01);
}

.plan-card.active-plan {
    border: 2px solid var(--primary);
    background: rgba(236, 72, 153, 0.05);
}

.plan-card.active-plan::after {
    content: 'ACTIVE PLAN';
    position: absolute;
    top: 14px;
    right: -26px;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 30px;
    transform: rotate(45deg);
    letter-spacing: 0.5px;
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.plan-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
}

.plan-price {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

.plan-price span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.plan-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 16px;
}

/* Admin Dashboard Desktop styling */
.admin-body {
    background: #090b14;
    color: #f1f5f9;
    font-family: var(--font-body);
    display: block;
    overflow-y: auto;
    padding: 30px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
}

.admin-header h1 {
    font-family: var(--font-display);
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-nav {
    display: flex;
    gap: 15px;
}

.admin-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.admin-nav a.active {
    background: rgba(236, 72, 153, 0.1);
    color: var(--primary);
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: rgba(18, 22, 47, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-val {
    font-size: 2.2rem;
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--text-primary);
}

/* Tables styling */
.admin-table-container {
    background: rgba(18, 22, 47, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 30px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th, .admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
    background: rgba(18, 22, 47, 0.8);
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.admin-table td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Modal and Forms */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(18, 22, 47, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 30px;
}

/* ==========================================
   Android-style UI/UX Enhancements
   ========================================== */

/* Modern Back Button for Android-like screen navigation */
.android-back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.android-back-btn:hover {
    transform: translateX(-3px);
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

/* Auth Container improvements */
.app-content.auth-mode-active {
    justify-content: flex-start;
    padding-top: 50px;
}

/* Material-like Android input container */
.android-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2px 16px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.android-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.1);
    background: rgba(15, 23, 42, 0.75);
}

.android-input-wrapper .input-icon-left {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-right: 12px;
    transition: color 0.3s ease;
}

.android-input-wrapper:focus-within .input-icon-left {
    color: var(--primary);
}

.android-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 14px 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none !important;
}

.android-input::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

/* Password Toggle Suffix Icon */
.input-icon-right {
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    margin-right: -8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.input-icon-right:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.input-icon-right:active {
    transform: scale(0.9);
}

/* Material Design style button with elevation & click wave */
.android-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 28px; /* Android Pill shape */
    padding: 16px 24px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--primary-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    letter-spacing: 0.3px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.android-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease-out, height 0.4s ease-out;
}

.android-btn:active::after {
    width: 250px;
    height: 250px;
}

.android-btn:hover {
    box-shadow: 0 12px 28px rgba(236, 72, 153, 0.45);
    filter: brightness(1.05);
}

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

/* Grid layout for two column inputs in Android */
.android-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Extra touch-ups for Android elements */
.form-group-android {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-android label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-left: 4px;
}
