/* =========================================
   1. MAIN APP FRAME (Profile Tab Only)
   ========================================= */
.app-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh - 70px); /* Bottom Nav ke liye jagah */
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    z-index: 1;
    padding: 10px;
    box-sizing: border-box;
}
.app-frame::-webkit-scrollbar { display: none; }


/* =========================================
   2. PROFILE CARD & MENU (Inside App Frame)
   ========================================= */
.app-frame .profile-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.app-frame .img-wrap {
    position: relative;
    width: 85px;
    height: 85px;
    margin: 0 auto 10px;
}

.app-frame .profile-pic-big {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-color);
}

.app-frame .edit-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 2px solid var(--card-bg);
    font-size: 12px;
}

.app-frame .user-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-color);
}
.app-frame .user-handle {
    font-size: 13px;
    color: var(--secondary-text);
    margin-bottom: 10px;
}

.app-frame .stats-row {
    display: flex;
    justify-content: space-around;
    padding: 10px 10px 0 10px;
    border-top: 1px solid var(--border-color);
}
.app-frame .stat-num {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}
.app-frame .stat-label {
    font-size: 0.7rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    font-weight: 600;
}

/* Main Menu Card */
.app-frame .menu-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

/* =========================================
   3. GLOBAL COMPONENTS (Settings & Edit Page Fix)
   ========================================= */
/* Ye styles ab .app-frame ke BAHAR hain taaki Settings page par bhi chalein */

/* Menu Items (Used in both Profile & Settings) */
.menu-item, .item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-color);
    transition: background 0.2s;
    background: var(--card-bg); /* Important for Settings Page */
}
.menu-item:last-child, .item:last-child { border-bottom: none; }
.menu-item:active, .item:active { background: var(--bg-color); }

.menu-icon, .item-icon {
    width: 30px;
    height: 30px;
    background: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-right: 12px;
    font-size: 14px;
}
.item-icon { background: transparent; font-size: 18px; color: var(--text-color); }

.menu-text, .item-title {
    font-size: 15px;
    font-weight: 500;
    flex-grow: 1;
}

/* Settings Page Specifics */
.section-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--secondary-text);
    margin: 20px 0 8px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.card-group {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
}
.item-right { color: var(--secondary-text); font-size: 13px; display: flex; align-items: center; }
.item-left { display: flex; align-items: center; }

/* Toggle Switch */
.toggle {
    width: 40px;
    height: 22px;
    background: var(--secondary-text);
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
    opacity: 0.5;
}
.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.item.active .toggle { background: var(--primary-color); opacity: 1; }
.item.active .toggle::after { transform: translateX(18px); }


/* =========================================
   4. EDIT PROFILE PAGE FIXES (Image Fix)
   ========================================= */
.edit-dp-wrapper {
    width: 110px;    /* Fixed width */
    height: 110px;   /* Fixed height */
    margin: 20px auto;
    position: relative;
    border-radius: 50%;
}

.edit-dp-img {
    width: 100%;     /* Parent ke hisab se fit */
    height: 100%;
    border-radius: 50%;
    object-fit: cover; /* Photo stretch nahi hogi */
    border: 4px solid var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.edit-cam-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 3px solid var(--bg-color);
    font-size: 14px;
    cursor: pointer;
}

.btn-update-profile {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    margin-top: 20px;
}

/* Logout Button */
.btn-logout {
    width: auto;
    min-width: 140px;
    padding: 10px 30px;
    margin: 0 auto;
    display: block;
    border-radius: 30px;
    border: none;
    color: white;
    background: var(--danger-color);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
    font-size: 14px;
}
