@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --primary: #673DE6;
    --primary-light: #845ef7;
    --background: #FFFFFF;
    --surface: #F9FAFB;
    --text-primary: #000000;
    --text-secondary: #6B7280;
    --radius-ios: 2rem;
    --shadow-ios: 0 4px 20px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Aeonik', 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-user-select: none;
    user-select: none;
    overflow-x: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.ios-card {
    background: var(--background);
    border-radius: var(--radius-ios);
    padding: 1.5rem;
    box-shadow: var(--shadow-ios);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-ios);
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    display: inline-block;
}

.btn-primary:active {
    transform: scale(0.98);
    background-color: var(--primary-light);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: var(--radius-ios);
    font-weight: 600;
    text-align: center;
    border: 1.5px solid #E5E7EB;
    cursor: pointer;
    width: 100%;
}

.input-ios {
    width: 100%;
    background-color: #F3F4F6;
    border: 1.5px solid transparent;
    border-radius: 1rem;
    padding: 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
}

.input-ios:focus {
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(103, 61, 230, 0.1);
}

/* PASSWORD TOGGLE */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    user-select: none;
}

/* NAVIGATION */
.nav-bottom {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 80px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
    border-radius: 40px 40px 0 0;
    z-index: 999999;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #000000;
    text-decoration: none;
    flex: 1;
    height: 100%;
    gap: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item .material-symbols-outlined {
    font-size: 24px;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    line-height: 1;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.nav-item.active .material-symbols-outlined {
    background-color: var(--primary);
    color: #FFFFFF !important;
    box-shadow: 0 4px 15px rgba(103, 61, 230, 0.3);
}

.nav-item span:not(.material-symbols-outlined) {
    font-size: 10px;
    font-weight: 400;
    color: #000000;
    display: block;
    margin-top: -17px;
    margin-bottom: 20px;
    line-height: 1;
}

.nav-item.active span:not(.material-symbols-outlined) {
    display: none;
}

/* PROFILE PAGE STYLES */
.profile-shell {
    padding: 20px 0;
    background: #FFFFFF;
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    margin-bottom: 30px;
}

.profile-header h1 {
    font-size: 18px;
    font-weight: 700;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid #F3F4F6;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.icon-btn.settings {
    color: var(--primary);
}

.profile-main-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--primary);
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.avatar-upload-btn .material-symbols-outlined {
    font-size: 20px;
    font-variation-settings: 'FILL' 1, 'wght' 400;
}

.user-name {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #000;
}

.profile-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.badge.role {
    background: #e8f7f0;
    color: #11ad7d;
}

.badge.points {
    background: #fff8e6;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-edit-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 25px;
    border: 1.5px solid #E5E7EB;
    background: white;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-profile:active {
    background: #F9FAFB;
    transform: scale(0.98);
}

/* STATS */
.profile-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px 0;
    border-top: 1px solid #F3F4F6;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

.stat-label {
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
}

/* TABS */
.profile-tabs {
    display: flex;
    border-top: 1.5px solid #F3F4F6;
    margin-top: 10px;
}

.tab-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    color: #6B7280;
    cursor: pointer;
    border-top: 2px solid transparent;
}

.tab-item.active {
    color: #000;
    border-top: 2px solid #000;
}

.tab-item .material-symbols-outlined {
    font-size: 24px;
}

/* POSTS GRID */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
}

.post-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #F3F4F6;
    position: relative;
}

.post-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-item .post-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 16px;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: 30px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
}

/* TOAST NOTIFICATION */
.toast-container {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000000;
    pointer-events: none;
}

.toast {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(103, 61, 230, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastSlideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastSlideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: toastSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastSlideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* EMPTY STATE */
.empty-state {
    padding: 60px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-state .material-symbols-outlined {
    font-size: 64px;
    color: #E5E7EB;
    font-variation-settings: 'wght' 200;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

.empty-state p {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.4;
}

/* Page transitions */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}