/*
 * RAJIB TELECOM - MOBILE APP STYLES
 * Ultra-Polished UI matching RAJIB_TELECOM_APP.pdf Screens 1, 2, 3, 4, 5, 6
 */

/* Mobile Viewport Wrapper */
.mobile-viewport-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #091224;
    padding: 24px 12px;
}

@media (max-width: 500px) {
    .mobile-viewport-wrapper {
        padding: 0;
        background: #ffffff;
        align-items: flex-start;
    }
}

/* Phone Container Frame */
.mobile-app-container {
    width: 100%;
    max-width: 430px;
    height: 880px;
    max-height: 94vh;
    background: #ffffff;
    border-radius: 40px;
    box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.6), 0 0 0 10px #1e293b;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

@media (max-width: 500px) {
    .mobile-app-container {
        border-radius: 0;
        box-shadow: none;
        height: 100vh;
        max-height: 100vh;
    }
}

/* Admin Switch Top Banner */
.admin-switch-banner {
    background: #0a1e3f;
    color: #ffffff;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    z-index: 1000;
}
.admin-switch-banner a {
    color: #38bdf8;
    text-decoration: underline;
}

/* Opening Splash Screen */
.app-splash-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #00122e;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}
.app-splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.splash-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.95;
}
.splash-content-overlay {
    position: relative;
    z-index: 2;
    padding: 40px 24px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(10,30,63,0.3) 0%, rgba(10,30,63,0.85) 100%);
}
.splash-logo-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    padding: 6px;
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.splash-logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.splash-footer {
    text-align: center;
    color: white;
    margin-bottom: 20px;
}
.splash-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255,255,255,0.25);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 14px auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Phone Status Bar (9:41) */
.mobile-status-bar {
    height: 44px;
    padding: 12px 24px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    z-index: 10;
    background: #ffffff;
    flex-shrink: 0;
}
.status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mobile App Header */
.app-header {
    padding: 10px 14px 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
    z-index: 10;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}
.app-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.app-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.app-header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    flex: 1;
}
.app-header-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 2px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.app-header-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.app-header-brand-name {
    font-size: 10px;
    font-weight: 800;
    color: #0052cc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-header-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.header-icon-btn:hover {
    background: #e2e8f0;
}

/* Mobile Scrollable Body */
.app-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 18px 90px 18px; /* High bottom padding to clear the fixed footer */
    background: #f8fafc;
    position: relative;
}

/* FIXED BOTTOM NAVIGATION BAR */
.mobile-bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 68px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
    padding: 0 8px;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

@media (max-width: 500px) {
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 99999;
    }
}

.nav-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    gap: 3px;
    flex: 1;
    height: 100%;
    transition: all 0.15s ease;
}
.nav-tab-item svg {
    width: 22px;
    height: 22px;
}
.nav-tab-item.active {
    color: #0052cc;
}
.nav-tab-item:hover {
    color: #0052cc;
}

/* Stepper (Screens 2, 3, 4) */
.app-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin: 6px 12px 22px 12px;
}
.app-stepper::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 36px;
    right: 36px;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    text-decoration: none;
}
.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}
.step-item.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 82, 204, 0.2);
}
.step-item.completed .step-circle {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}
.step-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
}
.step-item.active .step-label {
    color: var(--primary);
}

/* Selection Pills */
.section-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #475569;
    margin-bottom: 10px;
}
.pills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.radio-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.radio-pill label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.radio-pill input[type="radio"]:checked + label {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 3px 6px rgba(0, 82, 204, 0.3);
}

/* Brand Grid (Screen 3) */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.brand-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.brand-pill label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}
.brand-pill input[type="radio"]:checked + label {
    border-color: var(--primary);
    background: #e0edff;
    color: var(--primary);
}

/* Lead Source Grid (Screen 4) */
.source-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.source-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.source-pill label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 6px;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    gap: 6px;
    transition: all 0.2s ease;
}
.source-pill input[type="radio"]:checked + label {
    border-color: var(--primary);
    background: #e0edff;
    color: var(--primary);
}

/* App Card */
.app-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #f1f5f9;
}

/* Screen 5: Metrics Grid */
.metrics-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}
.metric-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.metric-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 4px;
}
.metric-value {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

/* Filter Chips (Screen 5) */
.filter-scroll-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 16px;
    scrollbar-width: none;
}
.filter-scroll-row::-webkit-scrollbar {
    display: none;
}
.filter-chip {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}
.filter-chip.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Customer Item Card (Screen 5) */
.customer-card-item {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.customer-card-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.cust-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.cust-card-info h4 {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 2px;
}
.cust-card-info p {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}
.cust-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}
.cust-timing {
    font-size: 11px;
    font-weight: 700;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 4px;
}
.cust-btn-group {
    display: flex;
    gap: 6px;
}

/* Screen 6: Profile Layout */
.profile-hero {
    background: linear-gradient(135deg, #0b4fdc 0%, #0a1e3f 100%);
    border-radius: var(--radius-lg);
    padding: 22px;
    color: white;
    margin-bottom: 16px;
    text-align: center;
}
.profile-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    margin: 0 auto 10px auto;
    border: 2px solid rgba(255,255,255,0.4);
}
.profile-name {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 2px;
}
.profile-phone {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}
.profile-quick-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}
.profile-quick-actions .btn-call,
.profile-quick-actions .btn-whatsapp {
    flex: 1;
    padding: 10px;
    font-size: 13px;
}

/* Profile Info Rows */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}
.info-row:last-child {
    border-bottom: none;
}
.info-label {
    color: #64748b;
    font-weight: 600;
}
.info-val {
    font-weight: 700;
    color: #0f172a;
    text-align: right;
}

/* Mobile Modal Global Fix: Ensure save buttons are always above navigation footer */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(10, 30, 63, 0.6) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100000 !important;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.modal-overlay.active {
    display: flex !important;
}
.modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 430px;
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: modalUp 0.25s ease-out;
}
@keyframes modalUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal-card form {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}
.modal-card .modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px;
    max-height: 60vh;
}
.modal-card .modal-footer {
    flex-shrink: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 14px 20px 24px 20px;
    display: flex;
    gap: 12px;
}
.modal-card .modal-footer button {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
}

