/* Modal styles for homepage login/register */
.modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.modal-content {
  background-color: #fff;
  padding: 0;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: modalSlideIn 0.3s ease-out;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 20px 25px 10px 25px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: #333;
  font-size: 1.5rem;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.close:hover,
.close:focus {
  color: #000;
}

.modal-body {
  padding: 25px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0056b3, #004085);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

/* Popup overlay styles for secondary popups */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.popup-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.popup-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.popup-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 70vh;
}

/* Notifications popup specific styles */
.notifications-popup {
    width: 400px;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
}

.notification-item.pm-invite {
    border-left: 4px solid #10b981;
}

.notification-item.pm-invite.unread {
    background: #ecfdf5;
}

.notification-content {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: #f3f4f6;
}

.notification-icon.pm-invite {
    background: #d1fae5;
    color: #065f46;
}

.notification-details {
    flex: 1;
    min-width: 0;
}

.notification-message {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.notification-time {
    font-size: 0.75rem;
    color: #6b7280;
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.notification-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-btn-primary {
    background: #3b82f6;
    color: white;
}

.notification-btn-primary:hover {
    background: #2563eb;
}

.notification-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.notification-btn-secondary:hover {
    background: #e5e7eb;
}

.notification-btn-success {
    background: #10b981;
    color: white;
}

.notification-btn-success:hover {
    background: #059669;
}

.notification-btn-danger {
    background: #ef4444;
    color: white;
}

.notification-btn-danger:hover {
    background: #dc2626;
}

.loading-state, .empty-state {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-state-icon {
    font-size: 3rem;
    opacity: 0.6;
}

/* PM Invitation popup specific styles */
.pm-invite-popup {
    width: 500px;
}

.pm-invite-card {
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    margin-bottom: 1.5rem;
}

.pm-invite-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pm-invite-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.pm-invite-details h4 {
    margin: 0 0 0.25rem 0;
    color: #065f46;
    font-size: 1.125rem;
}

.pm-invite-details p {
    margin: 0;
    color: #047857;
    font-size: 0.875rem;
}

.pm-invite-role {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: #10b981;
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 1rem 0;
}

.pm-invite-message {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #a7f3d0;
    margin: 1rem 0;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.5;
}

.pm-invite-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.pm-invite-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.pm-invite-btn-accept {
    background: #10b981;
    color: white;
}

.pm-invite-btn-accept:hover {
    background: #059669;
    transform: translateY(-1px);
}

.pm-invite-btn-decline {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.pm-invite-btn-decline:hover {
    background: #e5e7eb;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .popup-content {
        width: 95vw;
        max-height: 85vh;
        margin: 1rem;
    }
    
    .notifications-popup,
    .pm-invite-popup {
        width: 100%;
    }
    
    .popup-header {
        padding: 1rem;
    }
    
    .popup-body {
        padding: 1rem;
        max-height: 60vh;
    }
    
    .pm-invite-actions {
        flex-direction: column;
    }
    
    .pm-invite-btn {
        width: 100%;
    }
}