/* ==========================================================================
   👤 PROFILE PAGE - COMPLETE & UNIFIED CSS STYLESHEET
   ========================================================================== */
.profile-page {
  background-color: #f8f9fa;
  min-height: 100vh;
  padding: 40px 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}


/* 1. Page Container & Breadcrumbs */
.profile-page-container {
    background-color: #f8fafc;
    min-height: 100vh;
    padding-bottom: 50px;
}

.profile-wrapper {
    max-width: 1100px ;
    margin: 0 auto ;
    padding: 20px ;
    box-sizing: border-box ;
}

.breadcrumb-container {
    margin-bottom: 25px;
    font-size: 14px;
    color: #718096;
}

.breadcrumb-container strong {
    color: #2d3748;
}

/* 2. Side-by-Side Layout */
.profile-layout {
    display: flex ;
    flex-direction: row ;
    gap: 30px ;
    align-items: flex-start ;
    width: 100% ;
    box-sizing: border-box ;
}

.profile-sidebar {
    background: #ffffff ;
    flex: 0 0 260px ;
    width: 260px ;
    border-radius: 20px ;
    padding: 30px 20px ;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
    box-sizing: border-box !important;
    position: sticky !important;
    top: 20px !important;
    flex-shrink: 0 !important;
}

/* 3. Main Content Area */
.profile-main {
    flex: 1;
    min-width: 0 ;
    max-width: 850px ;
    display: flex ;
    flex-direction: column ;
    gap: 25px ;
    box-sizing: border-box ;
}

/* 4. Common Card Styling */
.profile-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    margin-bottom: 40px;
}

/* 5. Avatar Summary Card */
.profile-info-summary {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar-border {
    position: relative;
    width: 80px;
    height: 80px;
}

.avatar-border img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.camera-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #4f46e5;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    border: 2px solid white;
}

/* 6. Form Grid Styling */
.profile-form-grid{
    display: grid;
    grid-template-columns: repeat(6, 1fr); 
    gap: 20px;
    margin-top: 20px;
}

.profile-form-grid .input-group:nth-child(1),
.profile-form-grid .input-group:nth-child(2) {
    grid-column: span 3;
}

.profile-form-grid .input-group:nth-child(3),
.profile-form-grid .input-group:nth-child(4),
.profile-form-grid .input-group:nth-child(5) {
    grid-column: span 2;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 11px;
    font-weight: 700;
    color: #a0aec0;
    letter-spacing: 0.05em;
}

.input-group input, 
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: #4f46e5;
}

.readonly-input {
    background-color: #f7fafc;
    color: #718096;
    cursor: not-allowed;
}

/* 7. Buttons / Actions */
.profile-form-footer {
    grid-column: span 6;
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.btn-save {
    background: #4f46e5;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save:hover {
    background: #4338ca;
}

.btn-outline {
    background-color: #000000;
    color: #ffffff !important;
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.3s ease;
}

.btn-outline:hover {
    background-color: #333333;
    color: #ffffff !important;
}

.edit-profile {
    height: 12px;
    width: 12px;
    object-fit: contain;
    filter: brightness(0) invert(1); 
}

.referral-wrapper {
    display: flex;
    align-items: center;
}

.referral-input {
    flex: 1;
}

.section-icon {
    height: 12px;
    width: 12px;
}

/* 🟢 Modal Background Overlay */
.crop-modal-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.75) !important;
    display: flex; 
    align-items: center; 
    justify-content: center;
    z-index: 99999 !important;
}

/* 🟢 Modal Content Box Card */
.crop-modal-content {
    background: #ffffff !important;
    color: #1e293b !important;
    padding: 20px; 
    border-radius: 12px;
    max-width: 400px; 
    height: 430px;
    width: 90%; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.crop-modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a !important;
}

/* 🟢 The Canvas Frame Container */
.crop-area { 
    max-height: 280px; 
    height: 280px;
    width: 100%; 
    overflow: hidden; 
    background: #f8fafc !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.crop-area img { 
    max-width: 100%; 
    max-height: 100%; 
    display: block; 
}

.crop-modal-actions { 
    display: flex; 
    justify-content: flex-end; 
    gap: 12px; 
    margin-top: 20px; 
}

.btn-cancel { 
    background: #f1f5f9 !important; 
    color: #475569 !important; 
    border: 1px solid #cbd5e1 !important; 
    padding: 8px 10px;
    border-radius: 6px; 
    font-weight: 500;
    font-size: 12px;
    cursor: pointer; 
    transition: background 0.2s;
}

.btn-cancel:hover {
    background: #e2e8f0 !important;
}

.crop-modal-actions .btn-save { 
    background: #004d40 !important;
    color: #ffffff !important; 
    border: none !important; 
    padding: 8px 10px; 
    border-radius: 6px;
    font-size: 12px; 
    font-weight: 500;
    cursor: pointer; 
    transition: background 0.2s;
}

.crop-modal-actions .btn-save:hover {
    background: #00332c !important;
}


.profile-text h2{
    font-size: 20px;
}

.profile-text p{
    font-size: 15px;
}


.card-header h3{
    font-size: 12px;
}


/* ==========================================================================
   📱 RESPONSIVE MEDIA QUERIES FOR PROFILE PAGE
   ========================================================================== */

/* --- Tablets & Medium Screens (Max-width: 991px) --- */
@media screen and (max-width: 991px) {
    .profile-layout {
        flex-direction: column;
        gap: 16px;
    }

    .profile-sidebar {
        position: static;
        width: 100%;
        flex: none;
    }

    .profile-main {
        max-width: 100%;
        width: 100%;
    }

    .profile-card {
        padding: 20px;
    }

    .profile-wrapper {
        padding: 12px;
    }
}

/* --- Mobile Devices & Smaller Screens (Max-width: 768px) --- */
@media screen and (max-width: 768px) {
    .profile-form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .profile-form-grid .input-group:nth-child(1),
    .profile-form-grid .input-group:nth-child(2),
    .profile-form-grid .input-group:nth-child(3),
    .profile-form-grid .input-group:nth-child(4) {
        grid-column: span 1;
    }

    .profile-form-footer {
        grid-column: span 2; /* Span across the entire grid row */
        display: flex;
        flex-direction: row; /* Force items into a horizontal row */
        flex-wrap: nowrap;   /* Prevent wrapping to the next line */
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
    }

    .profile-form-footer .btn-outline {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 4px;
        font-size: 8px;
        gap: 4px;
        white-space: nowrap;
        box-sizing: border-box;
    }

    .profile-form-footer .btn-outline img.edit-profile {
        width: 10px;
        height: 10px;
        flex-shrink: 0;
    }
    
}

/* --- Small Mobile Screens (Max-width: 480px) --- */
@media screen and (max-width: 480px) {
    .profile-form-grid{
        grid-template-columns: 1fr;
    }

    .profile-form-grid .input-group:nth-child(1),
    .profile-form-grid .input-group:nth-child(2),
    .profile-form-grid .input-group:nth-child(3),
    .profile-form-grid .input-group:nth-child(4) {
        grid-column: span 2;
    }

    .profile-form-footer {
        grid-column: span 1;
    }

    .profile-text h2 {
        font-size: 18px;
    }

    .profile-text p {
        font-size: 13px;
        word-break: break-all;
    }

    .avatar-border {
        width: 65px;
        height: 65px;
        flex-shrink: 0;
    }

    .input-group input, 
    .input-group select {
        padding: 10px 12px;
        font-size: 10px;
    }

    .profile-form-footer .btn-outline {
        padding: 8px 2px;
        font-size: 9px;
    }
}