:root {
    --ios-bg: #F2F2F7;
    --ios-blue: #007AFF;
    --ios-gray: #8E8E93;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.3);
}

body {
    background-color: var(--ios-bg);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    color: #000;
    margin: 0;
    padding-top: 100px; /* Space for fixed header */
    padding-bottom: 90px; /* Space for fixed footer */
}

/* --- FIXED HEADER --- */
.ios-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: flex-end;
    padding: 0 20px 15px;
    z-index: 1000;
    border-bottom: 0.5px solid rgba(0,0,0,0.1);
}

.ios-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.ios-header .logout-link {
    margin-left: auto;
    color: #FF3B30;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
}

/* --- CARDS & UI --- */
.glass-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.ios-input {
    background: #F2F2F7;
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    width: 100%;
    font-size: 16px;
    outline: none;
}

.btn-ios {
    background: var(--ios-blue);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 16px;
    width: 100%;
    font-size: 17px;
    font-weight: 600;
    margin-top: 15px;
    transition: 0.2s;
}

.btn-ios:active {
    transform: scale(0.97);
    opacity: 0.8;
}

/* --- BOTTOM TAB BAR --- */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 12px;
    z-index: 1000;
    border-top: 0.5px solid rgba(0,0,0,0.1);
}

.nav-item {
    text-align: center;
    color: var(--ios-gray);
    text-decoration: none;
    flex: 1;
}

.nav-item i {
    font-size: 24px;
    display: block;
}

.nav-item span {
    font-size: 10px;
    font-weight: 500;
}

.nav-item.active {
    color: var(--ios-blue);
}

/* --- TEXT STYLES --- */
.welcome-text {
    font-size: 15px;
    color: var(--ios-gray);
    margin-bottom: 2px;
}

.user-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
}


/* Stats Grid for Mobile */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 18px;
    padding: 15px;
    text-align: left;
    border: 0.5px solid rgba(0,0,0,0.05);
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ios-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #000;
}

.stat-icon {
    font-size: 18px;
    margin-bottom: 8px;
    display: block;
}

/* Specific iOS Button for Recharge */
.btn-recharge {
    background: #34C759; /* iOS Green */
    color: white;
    border: none;
    border-radius: 12px;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 600;
    float: right;
    margin-top: -5px;
}

/* Section Titles */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 25px 5px 15px;
}


/* Brand Initials / Avatar */
.brand-initial {
    width: 50px;
    height: 50px;
    background: var(--ios-blue);
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    margin-right: 15px;
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.3);
}

/* Create Brand Button Style */
.create-brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #D1D1D6;
    border-radius: 20px;
    padding: 30px;
    text-decoration: none;
    color: #000;
    transition: 0.2s;
    background: transparent;
}

.create-brand-card:active {
    background: rgba(0, 122, 255, 0.05);
    border-color: var(--ios-blue);
    transform: scale(0.98);
}

.create-brand-card span {
    font-size: 16px;
}

/* --- Slim iOS Navigation Bar --- */
.ios-nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px; /* Reduced height from 90px */
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: grid;
    grid-template-columns: 1fr 2fr 1fr; /* Equal parts for perfect centering */
    align-items: center;
    padding: 0 16px;
    z-index: 2000;
    border-bottom: 0.5px solid rgba(0,0,0,0.1);
}

.nav-title {
    font-size: 17px;
    font-weight: 600;
    color: #000;
    text-align: center;
    display: block;
}

.nav-link {
    text-decoration: none;
    color: var(--ios-blue);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link i {
    font-size: 20px;
    font-weight: bold;
}

.nav-right {
    display: flex;
    justify-content: flex-end;
}

/* --- Content Adjustment --- */
body.ios-ready {
    background-color: #F2F2F7;
    margin: 0;
    padding: 0;
}

.ios-content {
    padding-top: 65px; /* Enough space for slim header */
    padding-bottom: 100px; /* Space for footer nav */
}

/* Fix for Bulky Cards */
.glass-card {
    background: #FFFFFF;
    border-radius: 12px; /* Slightly tighter corners */
    padding: 16px;
    margin-bottom: 15px;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}


/* Brand Icon Grid Layout */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    padding: 10px 5px;
}

.brand-icon-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.brand-icon-box:active {
    transform: scale(0.9);
}

.brand-icon-circle {
    width: 65px;
    height: 65px;
    background: #FFFFFF;
    border-radius: 18px; /* iOS Rounded Square Style */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 8px;
    overflow: hidden;
    border: 0.5px solid rgba(0,0,0,0.05);
}

.brand-icon-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-icon-circle i {
    font-size: 28px;
    color: var(--ios-blue);
}

.brand-name-label {
    font-size: 11px;
    font-weight: 600;
    color: #3A3A3C;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add Brand Specific Box */
.add-brand-box .brand-icon-circle {
    background: rgba(0, 122, 255, 0.05);
    border: 1.5px dashed rgba(0, 122, 255, 0.3);
    box-shadow: none;
}


.ios-modal {
    border-radius: 25px !important;
    border: none !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.ios-label {
    font-size: 11px;
    font-weight: 700;
    color: #8E8E93;
    margin-bottom: 6px;
    margin-left: 5px;
    display: block;
    letter-spacing: 0.5px;
}

/* On mobile, make it slide from bottom */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0;
        position: fixed;
        bottom: 0;
        width: 100%;
        transition: transform 0.3s ease-out;
    }
    .ios-modal {
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }
}