/* ============================================
   PROFILE PAGE - CSS VARIABLES SYSTEM
   ============================================
   সহজেই পরিবর্তনযোগ্য CSS Variables
   বাংলা ফন্ট সহ সব কিছু customize করা যাবে
   ============================================ */

:root {
    /* Layout Dimensions */
    --profile-max-width: 1400px;
    --profile-sidebar-width: 280px;
    --profile-main-width: 600px;
    --profile-gap: 20px;
    
    /* Colors */
    --profile-bg: #f8fafc;
    --profile-card-bg: #ffffff;
    --profile-border: #e4e6eb;
    --profile-text-primary: #1c1e21;
    --profile-text-secondary: #65676b;
    --profile-text-muted: #bcc0c4;
    --profile-primary: #667eea;
    --profile-primary-hover: #5568d3;
    --profile-gradient-start: #667eea;
    --profile-gradient-end: #764ba2;
    
    /* Spacing - % based for easy customization */
    --profile-padding: 2%;
    --profile-padding-sm: 1.5%;
    --profile-padding-xs: 1%;
    --profile-margin: 2%;
    --profile-margin-sm: 1.5%;
    --profile-margin-xs: 1%;
    
    /* Row-Specific Padding Controls */
    --profile-row-padding-top: 20px;
    --profile-row-padding-right: 0%;
    --profile-row-padding-bottom: 20px;
    --profile-row-padding-left: 0%;
    
    /* Border Radius */
    --profile-radius: 12px;
    --profile-radius-sm: 8px;
    --profile-radius-xs: 6px;
    --profile-radius-full: 50%;
    
    /* Shadows */
    --profile-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --profile-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    --profile-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --profile-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --profile-font-family-bangla: 'Noto Sans Bengali', 'Kalpurush', 'SolaimanLipi', sans-serif;
    --profile-font-size-base: 1rem;
    --profile-font-size-lg: 1.25rem;
    --profile-font-size-xl: 1.5rem;
    --profile-font-size-xxl: 2rem;
    --profile-font-size-sm: 0.875rem;
    --profile-font-size-xs: 0.75rem;
    --profile-line-height: 1.5;
    --profile-font-weight-normal: 400;
    --profile-font-weight-medium: 500;
    --profile-font-weight-semibold: 600;
    --profile-font-weight-bold: 700;
    
    /* Cover Photo */
    --profile-cover-height: 400px;
    
    /* Profile Picture */
    --profile-picture-size: 180px;
    --profile-picture-border: 5px;
    
    /* Z-index */
    --profile-z-cover: 1;
    --profile-z-info: 10;
    --profile-z-sticky: 100;
}

/* ============================================
   BANGLA FONT SUPPORT - GLOBAL
   ============================================ */

[lang="bn"],
.bangla-text,
.bn,
body {
    font-family: var(--profile-font-family-bangla), var(--profile-font-family);
}

/* ============================================
   MAIN LAYOUT STRUCTURE
   ============================================ */

body {
    background-color: var(--profile-bg);
    font-family: var(--profile-font-family-bangla), var(--profile-font-family);
    font-size: var(--profile-font-size-base);
    line-height: var(--profile-line-height);
    color: var(--profile-text-primary);
}

.profile-container {
    min-height: 100vh;
    background: var(--profile-bg);
}

/* ============================================
   PROFILE ROW SYSTEM
   ============================================ */

.profile-row {
    padding: var(--profile-row-padding-top) var(--profile-row-padding-right) var(--profile-row-padding-bottom) var(--profile-row-padding-left);
    margin-bottom: var(--profile-margin);
}

/* ============================================
   COVER PHOTO SECTION
   ============================================ */

.cover-photo-container {
    position: relative;
    height: var(--profile-cover-height);
    background: linear-gradient(135deg, var(--profile-gradient-start) 0%, var(--profile-gradient-end) 100%);
    overflow: hidden;
    z-index: var(--profile-z-cover);
}

.cover-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    font-size: var(--profile-font-size-xl);
}

.cover-photo-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.cover-photo-actions {
    position: absolute;
    top: 20px;
    right: 20px;
}

.btn-cover-action {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-family: var(--profile-font-family-bangla);
}

.btn-cover-action:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* ============================================
   PROFILE INFO SECTION
   ============================================ */

.profile-info-section {
    background: var(--profile-card-bg);
    padding: var(--profile-padding) 0;
    margin-top: -100px;
    position: relative;
    z-index: var(--profile-z-info);
}

.profile-main-info {
    display: flex;
    align-items: flex-end;
    gap: 2rem;
}

/* ============================================
   PROFILE PICTURE
   ============================================ */

.profile-picture-container {
    position: relative;
    margin-top: -150px;
}

.profile-picture {
    width: var(--profile-picture-size);
    height: var(--profile-picture-size);
    border-radius: var(--profile-radius-full);
    object-fit: cover;
    border: var(--profile-picture-border) solid white;
    box-shadow: var(--profile-shadow-lg);
    background: white;
}

.profile-picture-default {
    width: var(--profile-picture-size);
    height: var(--profile-picture-size);
    border-radius: var(--profile-radius-full);
    background: linear-gradient(135deg, var(--profile-gradient-start) 0%, var(--profile-gradient-end) 100%);
    border: var(--profile-picture-border) solid white;
    box-shadow: var(--profile-shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    font-weight: var(--profile-font-weight-bold);
}

.profile-picture-edit {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--profile-card-bg);
    border: 2px solid var(--profile-border);
    border-radius: var(--profile-radius-full);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--profile-shadow);
}

.profile-picture-edit:hover {
    background: var(--profile-primary);
    color: white;
    border-color: var(--profile-primary);
}

/* ============================================
   PROFILE DETAILS
   ============================================ */

.profile-details {
    flex: 1;
    padding-bottom: 1rem;
}

.profile-name {
    font-size: var(--profile-font-size-xxl);
    font-weight: var(--profile-font-weight-bold);
    color: var(--profile-text-primary);
    margin-bottom: 0.5rem;
    font-family: var(--profile-font-family-bangla);
}

.profile-username {
    color: var(--profile-text-secondary);
    font-size: var(--profile-font-size-base);
    margin-bottom: 1rem;
}

.profile-bio {
    color: var(--profile-text-primary);
    font-size: var(--profile-font-size-base);
    margin-bottom: 1rem;
    line-height: var(--profile-line-height);
    font-family: var(--profile-font-family-bangla);
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: var(--profile-font-size-lg);
    font-weight: var(--profile-font-weight-bold);
    color: var(--profile-text-primary);
}

.stat-label {
    font-size: var(--profile-font-size-sm);
    color: var(--profile-text-secondary);
    font-family: var(--profile-font-family-bangla);
}

/* ============================================
   PROFILE ACTIONS
   ============================================ */

.profile-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-profile-action {
    padding: 10px 24px;
    border-radius: var(--profile-radius-sm);
    font-weight: var(--profile-font-weight-semibold);
    font-size: var(--profile-font-size-base);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: var(--profile-font-family-bangla);
}

.btn-primary-profile {
    background: linear-gradient(135deg, var(--profile-gradient-start) 0%, var(--profile-gradient-end) 100%);
    color: white;
}

.btn-primary-profile:hover {
    transform: translateY(-2px);
    box-shadow: var(--profile-shadow-hover);
}

.btn-secondary-profile {
    background: var(--profile-card-bg);
    color: var(--profile-text-primary);
    border: 2px solid var(--profile-border);
}

.btn-secondary-profile:hover {
    background: var(--profile-bg);
}

/* ============================================
   PROFILE NAVIGATION TABS
   ============================================ */

.profile-nav {
    background: var(--profile-card-bg);
    border-top: 1px solid var(--profile-border);
    padding: 0;
    position: sticky;
    top: 60px;
    z-index: var(--profile-z-sticky);
}

.profile-nav-tabs {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.profile-nav-item {
    flex: 1;
}

.profile-nav-link {
    display: block;
    padding: 1rem 2rem;
    color: var(--profile-text-secondary);
    text-decoration: none;
    font-weight: var(--profile-font-weight-semibold);
    font-size: var(--profile-font-size-base);
    text-align: center;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-family: var(--profile-font-family-bangla);
}

.profile-nav-link:hover {
    color: var(--profile-primary);
    background: var(--profile-bg);
}

.profile-nav-link.active {
    color: var(--profile-primary);
    border-bottom-color: var(--profile-primary);
}

/* ============================================
   PROFILE CONTENT AREA
   ============================================ */

.profile-content {
    padding: var(--profile-padding) 0;
}

.profile-grid {
    display: grid;
    grid-template-columns: var(--profile-sidebar-width) 1fr var(--profile-sidebar-width);
    gap: var(--profile-gap);
    max-width: var(--profile-max-width);
    margin: 0 auto;
    padding: 0 var(--profile-padding);
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */

.profile-sidebar {
    position: sticky;
    top: 140px;
    align-self: start;
}

.profile-sidebar .card {
    background: var(--profile-card-bg);
    border-radius: var(--profile-radius);
    box-shadow: var(--profile-shadow);
    margin-bottom: var(--profile-margin);
    padding: var(--profile-padding);
}

.profile-sidebar .card-title {
    font-size: var(--profile-font-size-lg);
    font-weight: var(--profile-font-weight-bold);
    color: var(--profile-text-primary);
    margin-bottom: 1rem;
    font-family: var(--profile-font-family-bangla);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.profile-main-content {
    min-width: 0;
}

.profile-post-card {
    background: var(--profile-card-bg);
    border-radius: var(--profile-radius);
    box-shadow: var(--profile-shadow);
    margin-bottom: var(--profile-margin);
    padding: var(--profile-padding);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Large Screens (1200px - 1399px) */
@media (max-width: 1399px) {
    :root {
        --profile-sidebar-width: 260px;
        --profile-main-width: 580px;
        --profile-padding: 1.5%;
        --profile-margin: 1.5%;
    }
}

/* Desktop (992px - 1199px) */
@media (max-width: 1199px) {
    :root {
        --profile-sidebar-width: 240px;
        --profile-main-width: 520px;
        --profile-padding: 1%;
        --profile-margin: 1%;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-sidebar {
        display: none;
    }
    
    :root {
        --profile-padding: 15px;
        --profile-margin: 15px;
        --profile-row-padding-left: 15px;
        --profile-row-padding-right: 15px;
        --profile-cover-height: 300px;
        --profile-picture-size: 140px;
    }
    
    .profile-main-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-picture-container {
        margin-top: -70px;
    }
    
    /* Hide right sidebar on tablet */
    .col-lg-3.order-3 {
        display: none;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    :root {
        --profile-padding: 10px;
        --profile-margin: 10px;
        --profile-gap: 15px;
        --profile-row-padding-left: 10px;
        --profile-row-padding-right: 10px;
        --profile-cover-height: 200px;
        --profile-picture-size: 120px;
        --profile-font-size-xxl: 1.5rem;
        --profile-font-size-xl: 1.25rem;
        --profile-font-size-lg: 1.125rem;
    }
    
    .profile-stats {
        gap: 1rem;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .btn-profile-action {
        width: 100%;
    }
    
    .profile-nav-link {
        padding: 0.75rem 1rem;
        font-size: var(--profile-font-size-sm);
    }
    
    /* Mobile-specific improvements */
    .profile-card {
        border-radius: var(--profile-radius-sm);
    }
    
    .profile-main-info {
        text-align: center;
    }
    
    /* Better touch targets for mobile */
    .btn-profile-action {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    /* Improve readability on small screens */
    .profile-name {
        font-size: 1.75rem !important;
    }
    
    /* Stack stats vertically on very small screens */
    .profile-stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-item {
        min-width: 80px;
    }
}

/* Extra Small Mobile (< 576px) */
@media (max-width: 575px) {
    :root {
        --profile-padding: 8px;
        --profile-margin: 8px;
        --profile-row-padding-left: 5px;
        --profile-row-padding-right: 5px;
        --profile-picture-size: 100px;
        --profile-font-size-xxl: 1.25rem;
    }
    
    .profile-name {
        font-size: 1.5rem !important;
    }
    
    .profile-stats {
        font-size: 0.875rem;
        gap: 0.75rem;
    }
    
    .stat-item {
        min-width: 70px;
    }
    
    /* Smaller cards on mobile */
    .profile-card {
        margin-bottom: 0.75rem;
    }
    
    /* Better spacing for mobile */
    .card-body {
        padding: 1rem !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 1rem;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

/* Quick Links Hover Effect */
.card-body a:hover {
    background: var(--profile-bg) !important;
    color: var(--profile-primary) !important;
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--profile-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--profile-border);
    border-radius: var(--profile-radius-xs);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--profile-text-muted);
}

/* ============================================
   MOBILE FULL-WIDTH — ZERO PADDING/MARGIN
   Applies to all profile/* templates
   ============================================ */
@media (max-width: 767.98px) {

    /* ── Universal container/layout reset ── */
    .profile-container,
    .profile-container *,
    .profile-row,
    .profile-row * {
        box-sizing: border-box !important;
    }

    .profile-container,
    .profile-row {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Bootstrap .row negative margins → zero */
    .profile-container .row,
    .profile-row .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    /* Every Bootstrap column → full width, zero side padding */
    .profile-container [class*="col-"],
    .profile-row [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* ── Cards: flush edges, no shadow, no radius ── */
    .profile-container .card,
    .profile-container .profile-card,
    .profile-container .profile-header-card,
    .profile-container .sidebar-card,
    .profile-container .content-card,
    .profile-container .posts-section,
    .profile-container .edit-section,
    .profile-container .progress-indicator,
    .profile-container .rose-wallet-card {
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: none !important;
        border-top: 1px solid #e4e6eb !important;
        width: 100% !important;
    }

    /* ── Card bodies: zero horizontal padding ── */
    .profile-container .card-body,
    .profile-container .card-header,
    .profile-container .posts-body,
    .profile-container .posts-header {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* ── Hide left sidebar on mobile ── */
    .col-12.col-lg-3.order-2.order-lg-1 {
        display: none !important;
    }

    /* ── Profile cover: full bleed ── */
    .profile-cover {
        border-radius: 0 !important;
        height: 180px !important;
        margin: 0 !important;
    }

    /* ── Avatar ── */
    .profile-avatar,
    .profile-avatar-placeholder {
        width: 88px !important;
        height: 88px !important;
        font-size: 34px !important;
    }

    /* ── Name ── */
    .profile-name {
        font-size: 1.25rem !important;
    }

    /* ── Stats ── */
    .profile-stats {
        justify-content: center !important;
        gap: 14px !important;
        flex-wrap: wrap !important;
    }

    /* ── Action buttons: full width stacked ── */
    .profile-actions {
        flex-direction: column !important;
        gap: 8px !important;
        padding: 0 !important;
    }

    .profile-actions .btn,
    .profile-actions a,
    .btn-profile-primary,
    .btn-profile-outline,
    .btn-profile-danger,
    .btn-profile-action {
        width: 100% !important;
        text-align: center !important;
        margin: 0 !important;
    }

    /* ── Edit sections ── */
    .edit-section {
        padding: 14px 12px !important;
    }

    .save-btn {
        width: 100% !important;
    }

    /* ── Sidebar cards gap ── */
    .profile-sidebar {
        gap: 0 !important;
    }

    /* ── Friends grid ── */
    .friends-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
    }

    /* ── simple_edit.html container ── */
    .simple-edit-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .edit-card {
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 14px 12px !important;
        border-top: 1px solid #e4e6eb !important;
    }
}

@media (max-width: 400px) {
    .friends-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
