/* Font Imports 🌟 */
@font-face {
    font-family: 'IRANSansWeb';
    src: url('../fonts/IRANSansWeb.eot');
    src: url('../fonts/IRANSansWeb.eot?#iefix') format('embedded-opentype'),
         url('../fonts/IRANSansWeb.woff') format('woff'),
         url('../fonts/IRANSansWeb.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IRANSansWeb', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    letter-spacing: 0.5px;
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* Container 📏 */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation */
.user-nav {
    display: flex;
    padding: 20px;
    margin: 20px;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 1.5px 7px rgba(0,0,0,0.03);
    border-radius: 14px;
    transition: box-shadow 0.2s;
}

.user-nav-logo-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
    justify-content: flex-start; /* Align left when buttons exist 🌟 */
    width: auto; /* Allow natural width when buttons are present 📏 */
}

/* Hide user-nav-buttons when not logged in 🚫 */
.user-nav-buttons {
    display: none; /* Hidden by default 🚪 */
}

/* Show user-nav-buttons when logged in ✅ */
.user-nav-buttons.logged-in {
    display: flex;
    align-items: center;
}

/* Center user-nav-logo-title when only child (no buttons) 🎯 */
.user-nav > .user-nav-logo-title:only-child {
    justify-content: center; /* Center when no buttons 🚀 */
    width: 100%; /* Full width for centering 📏 */
}

.user-nav-logo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border: 2px solid #eee;
}

.user-nav-text {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: start;
}

.user-nav-title {
    font-size: 2rem;
    font-weight: bold;
    color: #2d3748;
    letter-spacing: 1px;
    font-family: inherit;
}

.user-nav-subtitle {
    font-size:12px;
    color:#888;
    margin-top:2px
}

.user-nav-buttons {
    display: flex;
    align-items: center;
}

.user-nav p {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 0;
}

.user-nav a {
    color: #4c6ef5;
    text-decoration: none;
    margin: 0 0.75rem;
    padding: 0.25rem 0;
    transition: all 0.2s ease;
    position: relative;
}

.user-nav a:hover {
    color: #3b5bdb;
}

.user-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #3b5bdb;
    transition: width 0.3s ease;
}

.user-nav a:hover::after {
    width: 100%;
}

a {
    text-decoration: none;
    color: #4c6ef5;
    transition: color 0.2s ease;
}

a:hover {
    color: #3b5bdb;
}

/* Profile Header 🖼️ */
.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
    padding: 3rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    margin-bottom: 0;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(76, 110, 245, 0.08) 0%, rgba(76, 110, 245, 0) 70%);
    border-radius: 50%;
}

.avatar {
    width: 220px;
    height: 220px;
    border-radius: 18px;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
    z-index: 2;
}

.avatar:hover {
    transform: scale(1.03) rotate(1deg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.profile-info {
    flex: 1;
    min-width: 0;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    position: relative;
    z-index: 1;
}

/* Info Table Styles 📋 */
.info-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.8rem;
}

.info-table tr {
    transition: all 0.2s ease;
}

.info-table tr:hover {
    background: rgba(248, 250, 252, 0.6);
}

.info-table td {
    padding: 0.8rem 1.2rem;
    vertical-align: middle;
    position: relative;
}

.info-table td:first-child {
    font-weight: 600;
    color: #4c6ef5;
    white-space: nowrap;
    padding-left: 1.5rem;
    width: 140px;
}

.info-table td:first-child::after {
    content: ':';
    position: absolute;
    left: 0.5rem;
    color: #94a3b8;
}

.info-table td:not(:first-child) {
    color: #334155;
    font-weight: 500;
    padding-right: 1rem;
}

.info-table a {
    color: #4c6ef5;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.info-table a:hover {
    color: #3b5bdb;
    text-decoration: underline;
}

.info-table a::before {
    content: '↗';
    font-size: 0.9em;
    opacity: 0.7;
}

/* Name Row Special Styling ✍️ */
.info-table tr:first-child td {
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #f1f5f9;
}

.info-table tr:first-child td.name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
}

/* Verified Badge ✅ */
.verified-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(45deg, #10b981, #0ea5e9);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
    animation: pulse 2s infinite;
    margin-right: 0.5rem;
}

.verified-badge::before {
    margin-left: 0.3rem;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Map Container 🗺️ */
.map-container {
    height: 400px;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

#map {
    height: 100%;
    width: 100%;
}

/* Button Container 🔘 */
.button-container {
    text-align: center;
    padding: 2.5rem;
    background: white;
    border-radius: 0 0 20px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    justify-content: center;
    align-items: center;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2.2rem;
    background: linear-gradient(45deg, #4c6ef5, #3b5bdb);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(76, 110, 245, 0.2);
    position: relative;
    overflow: hidden;
    min-width: 220px;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-back:hover {
    background: linear-gradient(45deg, #3b5bdb, #4c6ef5);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(76, 110, 245, 0.3);
}

.btn-back[style*="background-color: #e74c3c"] {
    background: linear-gradient(45deg, #ef4444, #dc2626) !important;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.2);
}

.btn-back[style*="background-color: #e74c3c"]:hover {
    background: linear-gradient(45deg, #dc2626, #ef4444) !important;
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.3);
}


/* Footer */
.footer {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #e9ebe9;
    color: rgb(8, 151, 247);
    border-radius: 8px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.footer p:last-child {
    margin-top: 18px; /* Adjust this value as needed */
}

/* Scoped link styles */
.tel a,
a.area-filter,
footer a {
    text-decoration: none !important;
    color: #4c6ef5;
    transition: color 0.2s cubic-bezier(.4,0,.2,1), background 0.2s cubic-bezier(.4,0,.2,1);
    position: relative;
}

.tel a:hover,
a.area-filter:hover,
footer a:hover {
    color: #2541b2;
    font-weight: 600;
}

.tel a:not(.btn-view-all):not(.button):not(button)::after,
a.area-filter:not(.btn-view-all):not(.button):not(button)::after,
footer a:not(.btn-view-all):not(.button):not(button)::after {
    content: '';
    display: block;
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: linear-gradient(90deg, #4c6ef5 0%, #2541b2 100%);
    transform: scaleX(0);
    transition: transform 0.2s cubic-bezier(.4,0,.2,1);
    border-radius: 2px;
}

.tel a:hover:not(.btn-view-all):not(.button):not(button)::after,
a.area-filter:hover:not(.btn-view-all):not(.button):not(button)::after,
footer a:hover:not(.btn-view-all):not(.button):not(button)::after {
    transform: scaleX(1);
}

/* Responsive Design 📱 */
@media (max-width: 992px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 2.5rem;
    }
    
    .avatar {
        width: 180px;
        height: 180px;
        margin-bottom: 1.5rem;
    }
    
    .profile-info {
        width: 100%;
        text-align: right;
    }
    
    .info-table td:first-child {
        width: 120px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0 1rem;
    }
    
    .container {
        margin: 1rem auto;
        border-radius: 16px;
    }
    
    .profile-header {
        padding: 2rem 1.5rem;
    }
    
    .avatar {
        width: 150px;
        height: 150px;
    }
    
    .profile-info {
        padding: 1.5rem;
    }
    
    .info-table {
        border-spacing: 0 0.6rem;
    }
    
    .info-table td {
        padding: 0.6rem 1rem;
    }
    
    .info-table td:first-child {
        width: 100px;
        padding-left: 1.2rem;
    }
    
    .info-table tr:first-child td.name {
        font-size: 1.2rem;
    }
    
    .map-container {
        height: 350px;
    }
    
    .button-container {
        padding: 2rem 1.5rem;
    }
    
    .btn-back {
        min-width: 180px;
        padding: 0.9rem 1.8rem;
    }
}

@media (max-width: 576px) {
    .profile-header {
        padding: 1.5rem 1rem;
    }
    
    .avatar {
        width: 130px;
        height: 130px;
    }
    
    .profile-info {
        padding: 1.2rem;
    }
    
    .info-table td {
        display: block;
        padding: 0.5rem 0;
    }
    
    .info-table td:first-child {
        width: 100%;
        padding-left: 0;
        margin-top: 0.8rem;
        color: #64748b;
        font-size: 0.9rem;
    }
    
    .info-table td:first-child::after {
        content: none;
    }
    
    .info-table td:not(:first-child) {
        padding-right: 0;
        font-size: 1rem;
    }
    
    .info-table tr {
        border-bottom: 1px solid #f1f5f9;
        padding-bottom: 0.8rem;
    }
    
    .info-table tr:first-child {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
    }
    
    .info-table tr:first-child td {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .info-table tr:first-child td:first-child {
        order: 1;
        flex: 0 0 100%;
        margin-top: 0;
    }
    
    .info-table tr:first-child td.name {
        order: 2;
        flex: 1;
        font-size: 1.3rem;
    }
    
    .info-table tr:first-child td:last-child {
        order: 3;
    }
    
    .map-container {
        height: 300px;
    }
    
    .button-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem 1rem;
    }
    
    .btn-back {
        width: 100%;
    }
}

/* Print styles 🖨️ */
@media print {
    body {
        background: white;
        padding: 0;
        color: #000;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .user-nav,
    .button-container {
        display: none;
    }
    
    .profile-header {
        flex-direction: row;
        background: none;
        padding: 1rem 0;
    }
    
    .avatar {
        width: 120px;
        height: 120px;
        border: 2px solid #ddd;
        box-shadow: none;
    }
    
    .profile-info {
        box-shadow: none;
        padding: 0 0 0 1rem;
    }
    
    .info-table td:first-child {
        color: #555;
    }
    
    .map-container {
        height: 250px;
        margin-top: 1rem;
    }
}

@media (max-width: 640px) {
    .user-nav {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .user-nav-logo-title {
        justify-content: center;
        width: 100%;
        margin-bottom: 18px;
    }

    .user-nav-buttons.logged-in {
        margin-top: 8px;
        width: 100%;
        justify-content: center;
    }
}