/* General Body Styles */
body {
    font-family: 'Inter', sans-serif; /* আধুনিক ফন্ট */
    margin: 0;
    padding: 0;
    background: #f0f2f5; /* হালকা ধূসর ব্যাকগ্রাউন্ড */
    color: #333;
    line-height: 1.6;
}

/* Container for Centering Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles (Unchanged from your original code) */
.main-header {
  background-color: #f5f5f5;
  padding: 10px 0;
  overflow-x: auto;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* হালকা শ্যাডো যোগ করা হয়েছে */
}

.nav-bar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-bar::-webkit-scrollbar {
  display: none;
}

.logo {
  margin-right: auto;
  flex-shrink: 0;
}

.logo img {
  height: 60px;
}

.nav-bar a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 8px 12px;
  transition: background 0.3s;
  flex-shrink: 0;
}

.nav-bar a:hover {
  background-color: #ddd;
  border-radius: 4px;
}

@media (max-width: 600px) {
  .nav-bar {
    white-space: nowrap;
  }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #6dd5ed, #2193b0); /* আকর্ষণীয় গ্র্যাডিয়েন্ট */
    padding: 6rem 0;
    text-align: center;
    color: white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.hero h1 {
    margin-bottom: 1rem;
    font-size: 2.8rem;
    color: white;
    font-weight: 700;
}

.hero p {
    margin-bottom: 2rem;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero .btn {
    display: inline-block;
    background: #004d7a; /* গাঢ় নীল বাটন */
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.hero .btn:hover {
    background: #00335c;
    transform: translateY(-2px);
}

/* Professionals Section */
.professionals-section {
    padding: 4rem 0;
    background-color: #ffffff;
    margin: 2rem auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.professionals-section h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 2.5rem;
    font-weight: 700;
}

/* Search and Filter Styles */
.search-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 3rem;
    flex-wrap: wrap; /* ছোট স্ক্রিনের জন্য র‍্যাপ */
}

.search-filter input[type="text"],
.search-filter select {
    padding: 12px 20px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    flex-grow: 1; /* ফ্লেক্স আইটেম হিসেবে বাড়বে */
    max-width: 350px; /* সর্বোচ্চ প্রস্থ নির্ধারণ */
}

.search-filter input[type="text"]:focus,
.search-filter select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* কলামের আকার সামঞ্জস্য করা হয়েছে */
    gap: 30px; /* ব্যবধান বাড়ানো হয়েছে */
    padding: 0 15px;
}

/* Profile Card */
.profile-card {
    background: #fff;
    border-radius: 15px; /* আরও গোলাকার কোণা */
    box-shadow: 0 6px 20px rgba(0,0,0,0.08); /* স্পষ্ট শ্যাডো */
    text-align: center;
    padding: 25px;
    display: flex; /* Flexbox ব্যবহার করা হয়েছে */
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%; /* গ্রিড আইটেমের পূর্ণ প্রস্থ */
    box-sizing: border-box; /* প্যাডিং এবং বর্ডার প্রস্থে অন্তর্ভুক্ত থাকবে */
}

.profile-card:hover {
    transform: translateY(-10px); /* হোভারে উপরে উঠবে */
    box-shadow: 0 12px 30px rgba(0,0,0,0.15); /* হোভারে আরও বড় শ্যাডো */
}

/* Wrapper for profile image and online indicator */
.profile-img-wrapper {
    position: relative;
    width: 120px; /* Same as image width */
    height: 120px; /* Same as image height */
    margin-bottom: 15px;
}

.profile-card img {
    width: 100%;
    height: 100%;
    border-radius: 50%; /* গোলাকার ছবি */
    object-fit: cover;
    border: 4px solid #007bff; /* নীল বর্ডার */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Online Indicator */
.online-indicator {
    width: 20px;
    height: 20px;
    background-color: #ccc; /* Default grey for offline or unknown */
    border-radius: 50%;
    border: 2px solid #fff; /* White border to stand out on darker images */
    position: absolute;
    bottom: 5px; /* Position at bottom right of the image */
    right: 5px;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.2); /* Small shadow for depth */
}

.online-indicator.active {
    background-color: #28a745; /* Green for online/active */
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.5); /* Glowing effect */
}
/* You can add .away, .busy, etc. classes with different colors if needed */
/* Example:
.online-indicator.away {
    background-color: #ffc107; // Yellow for away
}
.online-indicator.busy {
    background-color: #dc3545; // Red for busy
}
*/


.profile-card h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 5px;
    font-weight: 600;
}

.profile-card .profession {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
    font-weight: 400;
}

/* Wrapper for all chat buttons within a card */
.chat-options {
    display: flex;
    flex-direction: column; /* বাটনগুলো উল্লম্বভাবে */
    gap: 10px; /* বাটনগুলোর মধ্যে ব্যবধান */
    width: 100%;
    margin-top: auto; /* কার্ডের নিচে বাটনগুলোকে ঠেলে দেবে */
    max-width: 250px; /* বাটনের প্রস্থ নিয়ন্ত্রণ */
}

/* Wrapper for each button and its status/overlay */
.chat-option-wrapper {
    position: relative; /* For positioning the status area */
    width: 100%;
    flex-shrink: 0; 
    min-height: 80px; /* Adjusted: Enough space for button + status. Increased from 75px */
}

/* The actual chat button */
.chat-btn {
    padding: 12px 15px;
    border: 2px solid transparent; /* Default transparent border */
    border-radius: 8px; /* গোলাকার বাটন */
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, opacity 0.3s ease, border-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; /* Make button take full width of its wrapper */
    box-sizing: border-box; /* Include padding and border in width */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* বাটনে হালকা শ্যাডো */
    min-height: 48px; /* Ensure consistent height for all buttons */
    margin-top: 28px; /* Adjusted: Make space for chat-status-area above. Increased from 25px */
}

.chat-btn i {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* Styling for the ready state */
.chat-btn.chat-ready {
    border-color: #28a745; /* Green border when ready */
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.6); /* Enhanced shadow for ready state - made more prominent */
    background-color: #28a745 !important; /* Make ready button more prominent */
    color: white;
}

.chat-btn.chat-ready:hover {
    transform: translateY(-2px); /* Re-enable hover transform for ready state */
}


/* Styling for the status area above the button */
.chat-status-area {
    position: absolute;
    top: 0; /* Position above the button */
    left: 0;
    width: 100%;
    height: 25px; /* Fixed height for status area */
    display: flex; /* To center content */
    align-items: center;
    justify-content: center;
    gap: 5px; /* Space between spinner and text */
    background-color: rgba(255, 255, 255, 0.95); /* Adjusted: Slightly less transparent background for better readability */
    border-radius: 5px;
    font-size: 0.8rem; /* Adjusted: Slightly smaller font size for better fit */
    color: #333;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden; /* Hide overflow if text is too long */
    box-sizing: border-box;
    padding: 2px 5px;
    z-index: 2; /* Make sure it's above everything else in the wrapper */
    display: none; /* Hidden by default */
}

.chat-status-area .spinner { /* Spinner inside the status area */
    flex-shrink: 0; /* Prevents spinner from shrinking if text is long */
}
.chat-status-area .chat-status-text { /* Text inside the status area */
    overflow: hidden; /* Ensures text doesn't overflow */
    text-overflow: ellipsis; /* Adds ellipsis if text is too long */
    white-space: nowrap; /* Keeps text in one line */
}


/* Loading Spinner CSS */
.spinner {
  border: 3px solid #f3f3f3; /* Light grey */
  border-top: 3px solid #3498db; /* Blue */
  border-radius: 50%;
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  display: none; /* Hidden by default */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Chat button specific colors (unchanged, will be overridden by .chat-ready) */
.chat-btn.whatsapp {
    background-color: #25D366; 
    color: white;
}
.chat-btn.whatsapp:hover:not(:disabled) {
    background-color: #1DA851;
    transform: translateY(-2px);
}

.chat-btn.telegram {
    background-color: #0088CC; 
    color: white;
}
.chat-btn.telegram:hover:not(:disabled) {
    background-color: #006AA7;
    transform: translateY(-2px);
}

.chat-btn.direct-chat {
    background-color: #007bff; 
    color: white;
}
.chat-btn.direct-chat:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Disabled state for chat button (important to be after specific colors for override) */
.chat-btn:disabled {
    opacity: 0.7; /* লোডিং এর সময় অপাসিটি কমানো হয়েছে */
    cursor: not-allowed;
    background-color: #ccc !important; /* ডিসেবল অবস্থায় রঙ গাঢ় ধূসর */
    transform: none !important; /* লোডিং অবস্থায় হোভার ইফেক্ট বাতিল */
    box-shadow: none !important; /* লোডিং অবস্থায় শ্যাডো বাতিল */
    border-color: transparent !important; /* লোডিং অবস্থায় বর্ডার */
}


/* Footer Styles (Unchanged from your original code) */
.main-footer {
    background-color: #222; 
    color: #ffffff;
    padding: 1rem;
    text-align: center;
    font-size: 0.95rem;
    border-top: 1px solid #ddd;
    margin-top: 4rem; /* বডি থেকে ফুটারের ব্যবধান */
}
  
.main-footer nav a {
    color: #ffffff;
    margin: 0 0.5rem;
    text-decoration: none;
}
  
.main-footer nav a:hover {
    color: #ffd700;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .professionals-section h2 {
        font-size: 1.8rem;
    }
    .profile-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    .search-filter input[type="text"],
    .search-filter select {
        width: 100%;
        max-width: none;
    }
    /* Adjust chat-option-wrapper min-height for smaller screens */
    .chat-option-wrapper {
        min-height: 70px; /* Slightly less height if needed */
    }
    .chat-btn {
        margin-top: 22px; /* Adjust margin for status area height */
    }
    .chat-status-area {
        height: 22px;
        font-size: 0.8rem;
    }
    .chat-status-area .spinner { /* Spinner inside the status area */
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 4rem 0;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .hero p {
        font-size: 0.9rem;
    }
    .main-header .nav-bar a {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    .profile-card {
        padding: 20px;
    }
    .profile-card img {
        width: 100px;
        height: 100px;
    }
    .profile-card h3 {
        font-size: 1.5rem;
    }
    .profile-card .profession {
        font-size: 1rem;
    }
    .chat-btn {
        font-size: 0.9rem;
        padding: 10px 12px;
    }
    .main-footer nav a {
        display: block;
        margin: 0.3rem 0;
    }
    .chat-option-wrapper {
        min-height: 65px; /* Further adjust for very small screens */
    }
    .chat-btn {
        margin-top: 18px; 
    }
    .chat-status-area {
        height: 18px;
        font-size: 0.75rem;
    }
    .spinner {
        width: 15px;
        height: 15px;
    }
}